diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index c1e859e821..6387a940e0 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -386,6 +386,9 @@ Release 0.23.3 - UNRELEASED HADOOP-8088. User-group mapping cache incorrectly does negative caching on transient failures (Khiwal Lee via bobby) + HADOOP-8179. risk of NPE in CopyCommands processArguments() (Daryn Sharp + via bobby) + Release 0.23.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CopyCommands.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CopyCommands.java index 3d999ed54d..15155fac80 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CopyCommands.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CopyCommands.java @@ -81,10 +81,9 @@ protected void processArguments(LinkedList items) } FSDataOutputStream out = dst.fs.create(dst.path); try { - FSDataInputStream in = null; for (PathData src : srcs) { + FSDataInputStream in = src.fs.open(src.path); try { - in = src.fs.open(src.path); IOUtils.copyBytes(in, out, getConf(), false); if (delimiter != null) { out.write(delimiter.getBytes("UTF-8"));