Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C4A47F215 for ; Thu, 18 Apr 2013 20:27:30 +0000 (UTC) Received: (qmail 12795 invoked by uid 500); 18 Apr 2013 20:27:30 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 12770 invoked by uid 500); 18 Apr 2013 20:27:30 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 12762 invoked by uid 99); 18 Apr 2013 20:27:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Apr 2013 20:27:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Apr 2013 20:27:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9FFAB23888E7; Thu, 18 Apr 2013 20:27:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1469550 - /subversion/trunk/subversion/libsvn_client/merge.c Date: Thu, 18 Apr 2013 20:27:07 -0000 To: commits@subversion.apache.org From: breser@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130418202707.9FFAB23888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: breser Date: Thu Apr 18 20:27:07 2013 New Revision: 1469550 URL: http://svn.apache.org/r1469550 Log: Fix a potential segfault in merge. * subversion/libsvn_client/merge.c (find_reintegrate_merge): Move the test for yc_ancestor above the use of yc_ancestor to calculate source.ancestral. Modified: subversion/trunk/subversion/libsvn_client/merge.c Modified: subversion/trunk/subversion/libsvn_client/merge.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1469550&r1=1469549&r2=1469550&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/merge.c (original) +++ subversion/trunk/subversion/libsvn_client/merge.c Thu Apr 18 20:27:07 2013 @@ -11444,10 +11444,6 @@ find_reintegrate_merge(merge_source_t ** &yc_ancestor, source.loc2, source.loc1, target_ra_session, ctx, scratch_pool, scratch_pool)); - /* The source side of a reintegrate merge is not 'ancestral', except in - * the degenerate case where source == YCA. */ - source.ancestral = (loc1->rev == yc_ancestor->rev); - if (! yc_ancestor) return svn_error_createf(SVN_ERR_CLIENT_NOT_READY_TO_MERGE, NULL, _("'%s@%ld' must be ancestrally related to " @@ -11455,6 +11451,10 @@ find_reintegrate_merge(merge_source_t ** source.loc1->url, source.loc1->rev, source.loc2->url, source.loc2->rev); + /* The source side of a reintegrate merge is not 'ancestral', except in + * the degenerate case where source == YCA. */ + source.ancestral = (loc1->rev == yc_ancestor->rev); + if (source.loc1->rev > yc_ancestor->rev) { /* Have we actually merged anything to the source from the