Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-4132

when libwebhdfs is not enabled, nativeMiniDfsClient frees uninitialized memory

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3-alpha
    • Fix Version/s: 2.0.3-alpha
    • Component/s: libhdfs
    • Labels:
      None

      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

        1. HDFS-4132.001.patch
          4 kB
          Colin McCabe

        Issue Links

          Activity

            People

            • Assignee:
              cmccabe Colin McCabe
              Reporter:
              cmccabe Colin McCabe

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment