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

Potential null dereference in DFSck#doWork()

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.1
    • Fix Version/s: 2.10.0, 3.2.0, 3.1.1, 2.9.2
    • Component/s: None
    • Labels:
    • Hadoop Flags:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: