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

when libwebhdfs is not enabled, nativeMiniDfsClient frees uninitialized memory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.3-alpha
    • 2.0.3-alpha
    • libhdfs
    • 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

              cmccabe Colin McCabe
              cmccabe Colin McCabe
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: