Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.3-alpha
-
None
-
Reviewed
Description
When libwebhdfs is not enabled, nativeMiniDfsClient frees uninitialized memory.
Details: jconfStr is declared uninitialized...
struct NativeMiniDfsCluster* nmdCreate(struct NativeMiniDfsConf *conf) { struct NativeMiniDfsCluster* cl = NULL; jobject bld = NULL, bld2 = NULL, cobj = NULL; jvalue val; JNIEnv *env = getJNIEnv(); jthrowable jthr; jstring jconfStr;
and only initialized later if conf->webhdfsEnabled:
... if (conf->webhdfsEnabled) { jthr = newJavaStr(env, DFS_WEBHDFS_ENABLED_KEY, &jconfStr); if (jthr) { printExceptionAndFree(env, jthr, PRINT_EXC_ALL, ...
Then we try to free this uninitialized memory at the end, usually resulting in a crash.
(*env)->DeleteLocalRef(env, jconfStr);
return cl;
Attachments
Attachments
Issue Links
- duplicates
-
HDFS-4136 libhdfs segfaults after recent changes
- Resolved