From f055a53b43322a8d80a4aa362ec2a71d446334e7 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Thu, 12 Apr 2018 17:47:37 +0900 Subject: [PATCH] HDFS-7101. Potential null dereference in DFSck#doWork(). Contributed by skrho and Ted Yu. (cherry picked from commit 113af12cfb240ea9a7189bb2701693466eb8e993) --- .../src/main/java/org/apache/hadoop/hdfs/tools/DFSck.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSck.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSck.java index 199f4592de1..0c69b6de813 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSck.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSck.java @@ -350,7 +350,7 @@ public class DFSck extends Configured implements Tool { BufferedReader input = new BufferedReader(new InputStreamReader( stream, "UTF-8")); String line = null; - String lastLine = null; + String lastLine = NamenodeFsck.CORRUPT_STATUS; int errCode = -1; try { while ((line = input.readLine()) != null) {