Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65B4B18AAB for ; Tue, 9 Feb 2016 22:39:38 +0000 (UTC) Received: (qmail 79309 invoked by uid 500); 9 Feb 2016 22:24:22 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 78628 invoked by uid 500); 9 Feb 2016 22:24:22 -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 Received: (qmail 76038 invoked by uid 99); 9 Feb 2016 22:21:00 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2016 22:21:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 4C5DFC0BDD for ; Tue, 9 Feb 2016 22:21:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.05 X-Spam-Level: X-Spam-Status: No, score=-1.05 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.329, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 4e9hSrVmb15w for ; Tue, 9 Feb 2016 22:20:57 +0000 (UTC) Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id AB4F520CB7 for ; Tue, 9 Feb 2016 22:20:56 +0000 (UTC) Received: from dovecot03.posteo.de (dovecot03.posteo.de [172.16.0.13]) by mout01.posteo.de (Postfix) with ESMTPS id 0479920B40 for ; Tue, 9 Feb 2016 23:20:49 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3q0JZn3XgFz5vN8; Tue, 9 Feb 2016 23:20:49 +0100 (CET) Subject: Re: [PATCH] Fix for access violation in svn_fs__path_valid() To: Daniel Shahaf References: <56AE9A08.6090806@gmx.de> <20160207002206.GD13224@tarsus.local2> <56B7A02C.1010705@posteo.de> <20160209032259.GB19531@tarsus.local2> Cc: dev@subversion.apache.org From: Stefan Message-ID: <56BA663A.7040300@posteo.de> Date: Tue, 9 Feb 2016 23:20:42 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160209032259.GB19531@tarsus.local2> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2/9/2016 04:22, Daniel Shahaf wrote: > Stefan wrote on Sun, Feb 07, 2016 at 20:51:08 +0100: >> On 2/7/2016 01:22, Daniel Shahaf wrote: >>> Stefan wrote on Mon, Feb 01, 2016 at 00:34:32 +0100: >>>> +++ fs-loader.c (working copy) >>>> @@ -461,7 +461,8 @@ >>>> if (! svn_utf__cstring_is_valid(path)) >>>> { >>>> return svn_error_createf(SVN_ERR_FS_PATH_SYNTAX, NULL, >>>> - _("Path '%s' is not in UTF-8"), path); >>>> + _("Path '%s' is not in UTF-8"), >>>> + path ? path : "NULL"); >>> Is this actually a problem? svn_error_createf() uses apr_pvsprintf() >>> which (by code inspection) accepts NULL here. >> TBH I didn't look further... Just assumed that apr_pvsprintf() would just be >> a redefine. If it's a specific implementation which checks for NULL here and >> handles it, then pls disregard my patch. > https://svn.apache.org/viewvc/apr/apr/tags/1.3.0/memory/unix/apr_pools.c?revision=661875&view=markup#l1100 > https://svn.apache.org/viewvc/apr/apr/tags/1.3.0/strings/apr_snprintf.c?revision=661875&view=markup#l953 > > I didn't check later versions. (In theory, apr-2.0 might have > changed this behaviour. I have no reason to think it did.) Right, with these references found the code in the 1.5.2 source and it's still the same there (with regards to checking for null-ptrs with %s). Thanks for digging out the references for me > >> P.S. I tried to check out the function definition myself, but could only >> spot the declaration in the apr source. Couldn't trace down where the >> function is defined... > I found it with ctags(1) with -IAPR_DECLARE: > > % ctags --extra=+qf --c-types=+p --python-types=-i -IAPR_DECLARE -R . > % grep apr_pvsprintf tags > apr_pvsprintf include/apr_strings.h /^APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap);$/;" p > apr_pvsprintf memory/unix/apr_pools.c /^APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *pool, const char *fmt, va_list ap)$/;" f > % vim -t apr_pvsprintf > Was always there in front of me directly. Should have just looked at the code. At first spot to me it looked as if it wouldn't apply here, since the definitions were in memory/unix/xxx and I assumed that's just code which is unix specific... And I got confused by APR_DECLARE() assuming that these were just forward declarations of these functions... Now me knows better. ;-) Regards, Stefan