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 CC3051740C for ; Wed, 26 Aug 2015 07:18:06 +0000 (UTC) Received: (qmail 44364 invoked by uid 500); 26 Aug 2015 07:18:06 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 44317 invoked by uid 500); 26 Aug 2015 07:18:06 -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 44307 invoked by uid 99); 26 Aug 2015 07:18:06 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Aug 2015 07:18:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C731C181939 for ; Wed, 26 Aug 2015 07:18:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=wandisco.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 09lJJh5ENOIY for ; Wed, 26 Aug 2015 07:17:50 +0000 (UTC) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id F3DB820382 for ; Wed, 26 Aug 2015 07:17:49 +0000 (UTC) Received: by wicja10 with SMTP id ja10so6042691wic.1 for ; Wed, 26 Aug 2015 00:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wandisco.com; s=gapps; h=subject:to:references:from:organization:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=0XXRq2Wj0mVkLapAUQtlTRydM1CTfRnf3Eg0r7GUpmE=; b=OM9zLyTngjNldmctIZ4qvJz+V1UAh9m7GEo9Hnkk8deFSnUB+0XNLp2wMaO2wCZWiR cSwhLiPiLEE6Lwfyq3zpHt17untc8UepDEjF16EvQsq2QPKicapIQHHQNcbQA4eYzsET OHSgwbFxUKWvRASNQegxYtP3VoqoRG3gzseVk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=0XXRq2Wj0mVkLapAUQtlTRydM1CTfRnf3Eg0r7GUpmE=; b=KhCVjGqIiBzv/c1LoEInbzwzoGMc6N4yyesYlq2arudhFMzpYGUBRDrk0rXac8qRGj 0EM9ErlinGYSOgNkA17tOIm0k7J8fat0cWTisCZeRlUNAweEwUsSvU4kukKKIKY6vhgj 0Fk2uPI9fhEq4JhjM81R42PMJLE9OgKPxhCH8wycn6FbmfPqENbTaYPmb5ht088v8LJJ WbU6KMoP+7QdZMpt4vuNcFcfp6n90bjxH7xQRJVRFckyPHKUBDG6Q3Be/1oc5cAvNH6Z qsxfjMsC0C0kOSjFAmyPBS7Sr8qcBO1bMXaasfeDRVSILG73ZUVHNoNeKzKD/yLIbf5n OJbQ== X-Gm-Message-State: ALoCoQmpm8dEucJ3kBKScX8iIJ4U3JTKfBqmyFiFMjlnqSspk1/zoya43Jm2ab/KyAyK59Kn0mrn X-Received: by 10.194.236.161 with SMTP id uv1mr57962277wjc.158.1440573463130; Wed, 26 Aug 2015 00:17:43 -0700 (PDT) Received: from zulu.localdomain (cpe-46-164-25-84.dynamic.amis.net. [46.164.25.84]) by smtp.gmail.com with ESMTPSA id j2sm2391860wjq.5.2015.08.26.00.17.42 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 26 Aug 2015 00:17:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by zulu.localdomain (Postfix) with ESMTP id ED950F7BB2EB for ; Wed, 26 Aug 2015 09:17:40 +0200 (CEST) Subject: Re: svn commit: r1697828 - /subversion/trunk/subversion/libsvn_subr/cache-membuffer.c To: dev@subversion.apache.org References: <20150826071500.46E7AAC0479@hades.apache.org> From: =?UTF-8?Q?Branko_=c4=8cibej?= Organization: WANdisco Message-ID: <55DD6814.5040906@wandisco.com> Date: Wed, 26 Aug 2015 09:17:40 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150826071500.46E7AAC0479@hades.apache.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 26.08.2015 09:14, brane@apache.org wrote: > Author: brane > Date: Wed Aug 26 07:14:59 2015 > New Revision: 1697828 > > URL: http://svn.apache.org/r1697828 > Log: > Fix a 64-bit to 32-bit conversion warning on 64-bit platforms. > > * subversion/libsvn_subr/cache-membuffer.c > (prefix_pool_get_internal): Safely cast a pointer to an index, with range check. > > Modified: > subversion/trunk/subversion/libsvn_subr/cache-membuffer.c > > Modified: subversion/trunk/subversion/libsvn_subr/cache-membuffer.c > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache-membuffer.c?rev=1697828&r1=1697827&r2=1697828&view=diff > ============================================================================== > --- subversion/trunk/subversion/libsvn_subr/cache-membuffer.c (original) > +++ subversion/trunk/subversion/libsvn_subr/cache-membuffer.c Wed Aug 26 07:14:59 2015 > @@ -339,7 +339,9 @@ prefix_pool_get_internal(apr_uint32_t *p > value = apr_hash_get(prefix_pool->map, prefix, prefix_len); > if (value != NULL) > { > - *prefix_idx = value - prefix_pool->values; > + const apr_size_t index = value - prefix_pool->values; > + SVN_ERR_ASSERT(index < prefix_pool->values_used); > + *prefix_idx = (apr_uint32_t) index; > return SVN_NO_ERROR; > } Stefan2, please double-check this change. It's not strictly correct since the type of the expression is ptrdiff_t, not size_t. In any case, I wasn't comfortable with just blindly casting the result. -- Brane