From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 586D61F4B4 for ; Wed, 30 Dec 2020 06:20:05 +0000 (UTC) Received: from localhost ([::1]:55190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kuUq4-0007Ti-0J for normalperson@yhbt.net; Wed, 30 Dec 2020 01:20:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kuUpw-0007T8-Qn for bug-gnulib@gnu.org; Wed, 30 Dec 2020 01:19:58 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:57304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kuUpu-0004kz-Ji for bug-gnulib@gnu.org; Wed, 30 Dec 2020 01:19:56 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 754781600F7; Tue, 29 Dec 2020 22:19:51 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Kw8AlvY_WSD1; Tue, 29 Dec 2020 22:19:50 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B184F1600F8; Tue, 29 Dec 2020 22:19:50 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id dQC4834fXJ_3; Tue, 29 Dec 2020 22:19:50 -0800 (PST) Received: from [192.168.1.9] (cpe-23-243-218-95.socal.res.rr.com [23.243.218.95]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 84F311600F7; Tue, 29 Dec 2020 22:19:50 -0800 (PST) Subject: Re: [PATCH v3 4/6] stdlib: Sync canonicalize with gnulib [BZ #10635] [BZ #26592] [BZ #26341] [BZ #24970] From: Paul Eggert To: Adhemerval Zanella References: <20201229193454.34558-1-adhemerval.zanella@linaro.org> <20201229193454.34558-5-adhemerval.zanella@linaro.org> <7644672f-434b-be1c-c8f0-288d038b018b@cs.ucla.edu> Organization: UCLA Computer Science Department Message-ID: <5125d6b0-83ba-a093-3afd-5a0bfb65b659@cs.ucla.edu> Date: Tue, 29 Dec 2020 22:19:50 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <7644672f-434b-be1c-c8f0-288d038b018b@cs.ucla.edu> Content-Type: multipart/mixed; boundary="------------3E830F195BC5FE999F03DB00" Content-Language: en-US Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -52 X-Spam_score: -5.3 X-Spam_bar: ----- X-Spam_report: (-5.3 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-1.07, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bug-gnulib@gnu.org, libc-alpha@sourceware.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" This is a multi-part message in MIME format. --------------3E830F195BC5FE999F03DB00 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 12/29/20 7:39 PM, Paul Eggert wrote: > Unfortunately that patch didn't correctly treat size-calculation > overflow like other out-of-memory situations. I installed the attached > further patch into Gnulib. Aaaaand even that patch mishandled errno on size-calculation overflow, so I installed the attached into Gnulib as well. Hope this finally does it. --------------3E830F195BC5FE999F03DB00 Content-Type: text/x-patch; charset=UTF-8; name="0001-lib-canonicalize-lgpl.c-realpath_stk-Set-errno-prope.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-lib-canonicalize-lgpl.c-realpath_stk-Set-errno-prope.pa"; filename*1="tch" >From ed5ce2ad20fb12f60fa2bdb95c0c2a7fe7ce1114 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 29 Dec 2020 22:17:46 -0800 Subject: [PATCH] * lib/canonicalize-lgpl.c (realpath_stk): Set errno properly. --- lib/canonicalize-lgpl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c index 01b06322d..49596f835 100644 --- a/lib/canonicalize-lgpl.c +++ b/lib/canonicalize-lgpl.c @@ -344,7 +344,10 @@ realpath_stk (const char *name, char *resolved, end_idx = end - extra_buf; size_t len = strlen (end); if (NARROW_ADDRESSES && INT_ADD_OVERFLOW (len, n)) - goto error_nomem; + { + __set_errno (ENOMEM); + goto error_nomem; + } while (extra_buffer.length <= len + n) { if (!scratch_buffer_grow_preserve (&extra_buffer)) -- 2.27.0 --------------3E830F195BC5FE999F03DB00--