cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6463] Preventing NPE if InputStream is null
Date Fri, 06 May 2016 11:45:56 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 46247c841 -> 0dc95c180


[CXF-6463] Preventing NPE if InputStream is null


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0dc95c18
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0dc95c18
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0dc95c18

Branch: refs/heads/3.1.x-fixes
Commit: 0dc95c1807c1f22d67577099241176600c46d852
Parents: 46247c8
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri May 6 12:42:27 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri May 6 12:45:39 2016 +0100

----------------------------------------------------------------------
 core/src/main/java/org/apache/cxf/helpers/IOUtils.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0dc95c18/core/src/main/java/org/apache/cxf/helpers/IOUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/helpers/IOUtils.java b/core/src/main/java/org/apache/cxf/helpers/IOUtils.java
index b14c96c..5c4d189 100644
--- a/core/src/main/java/org/apache/cxf/helpers/IOUtils.java
+++ b/core/src/main/java/org/apache/cxf/helpers/IOUtils.java
@@ -142,6 +142,9 @@ public final class IOUtils {
 
     public static int copy(final InputStream input, final OutputStream output)
         throws IOException {
+        if (input == null) {
+            return 0;
+        }
         if (output instanceof CopyingOutputStream) {
             return ((CopyingOutputStream)output).copyFrom(input);
         }


Mime
View raw message