From dev-return-38459-archive-asf-public=cust-asf.ponee.io@subversion.apache.org Mon Oct 29 16:51:39 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 46E3B180627 for ; Mon, 29 Oct 2018 16:51:39 +0100 (CET) Received: (qmail 64288 invoked by uid 500); 29 Oct 2018 15:51:38 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Delivered-To: moderator for dev@subversion.apache.org Received: (qmail 30309 invoked by uid 99); 29 Oct 2018 15:36:07 -0000 References: X-Mailer: LuaSocket 3.0-rc1 Date: Mon, 29 Oct 2018 15:36:06 -0000 MIME-Version: 1.0 x-ponymail-sender: a5dc9b12e77033dd6d8ea699dbe26ec0a66932ad x-ponymail-agent: PonyMail Composer/0.3 Subject: [PATCH] Coredump when javahl SVNClient::diff() called with diff-cmd set Content-Type: text/plain; charset=utf-8 Message-ID: From: matthew.burt@nats.co.uk In-Reply-To: To: [[[ Prevent some coredumps when using JavaHL SVNClient::diff() SVNClient::diff() discards output to stderr by setting stderr parameters to NULL in some calls Some of the called code can dereference the NULL in some situations. One such situation is if the user has set a diff-cmd value in their settings file. The documented interface to relevant routines does not say that stderr can be set to NULL in this way. Observed in the 1.10.3 client * subversion/bindings/javahl/native/SVNClient.cpp (SVNClient::diff): Replace NULL stderr in calls to (deprecated) svn_client_diff_peg6() and svn_client_diff6() with svn_stream_empty objects. ]]] Index: subversion/bindings/javahl/native/SVNClient.cpp =================================================================== --- subversion/bindings/javahl/native/SVNClient.cpp (revision 1845130) +++ subversion/bindings/javahl/native/SVNClient.cpp (working copy) @@ -1055,7 +1055,8 @@ void SVNClient::diff(const char *target1, Revision options.useGitDiffFormat(), SVN_APR_LOCALE_CHARSET, outputStream.getStream(subPool), - NULL /* error file */, + // discard stderr + svn_stream_empty(subPool.getPool()), changelists.array(subPool), ctx, subPool.getPool()), @@ -1084,7 +1085,8 @@ void SVNClient::diff(const char *target1, Revision options.useGitDiffFormat(), SVN_APR_LOCALE_CHARSET, outputStream.getStream(subPool), - NULL /* error stream */, + // discard stderr + svn_stream_empty(subPool.getPool()), changelists.array(subPool), ctx, subPool.getPool()),