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

Potential null dereference in DFSck#doWork()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.5.1
    • 2.10.0, 3.2.0, 3.1.1, 2.9.2
    • None
    • Reviewed

    Description

          String lastLine = null;
          int errCode = -1;
          try {
            while ((line = input.readLine()) != null) {
      ...
          if (lastLine.endsWith(NamenodeFsck.HEALTHY_STATUS)) {
            errCode = 0;
      

      If the input stream is empty, lastLine is kept null, leading to NPE.

      Attachments

        1. HDFS-7101_001.patch
          0.9 kB
          skrho
        2. HDFS-7101.v1.patch
          0.8 kB
          Ted Yu

        Activity

          People

            rsk13th skrho
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: