Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D88F72009FB for ; Fri, 6 May 2016 13:46:44 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D39CC160A0C; Fri, 6 May 2016 11:46:44 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1F8B51609F6 for ; Fri, 6 May 2016 13:46:43 +0200 (CEST) Received: (qmail 2917 invoked by uid 500); 6 May 2016 11:46:43 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 2907 invoked by uid 99); 6 May 2016 11:46:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 May 2016 11:46:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 17F0CDFC7E; Fri, 6 May 2016 11:46:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: <5930ea59379e41a089cfd046496d6bce@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: [CXF-6463] Preventing NPE if InputStream is null Date: Fri, 6 May 2016 11:46:43 +0000 (UTC) archived-at: Fri, 06 May 2016 11:46:45 -0000 Repository: cxf Updated Branches: refs/heads/3.0.x-fixes a7c8edeaa -> 6e3b8bad8 [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/6e3b8bad Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6e3b8bad Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6e3b8bad Branch: refs/heads/3.0.x-fixes Commit: 6e3b8bad8141e078f8fc1daf7d3bd80bf52f4170 Parents: a7c8ede Author: Sergey Beryozkin Authored: Fri May 6 12:42:27 2016 +0100 Committer: Sergey Beryozkin Committed: Fri May 6 12:46:25 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/6e3b8bad/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 9232fe3..dee6f51 100644 --- a/core/src/main/java/org/apache/cxf/helpers/IOUtils.java +++ b/core/src/main/java/org/apache/cxf/helpers/IOUtils.java @@ -141,6 +141,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); }