From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.cs.ucla.edu (mail.cs.ucla.edu [131.179.128.66]) by sourceware.org (Postfix) with ESMTPS id 784A53856973 for ; Wed, 17 May 2023 18:08:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 784A53856973 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id D86B23C020F7C; Wed, 17 May 2023 11:08:39 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id sAjqUaW5mTtT; Wed, 17 May 2023 11:08:39 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id A08BD3C097AFF; Wed, 17 May 2023 11:08:39 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu A08BD3C097AFF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1684346919; bh=P/DGni8vj0ksWASegthv82tZeu1kWLIAUlVZdm8dlMc=; h=Message-ID:Date:MIME-Version:To:From; b=J4Txy2BNfXPpUGZ4rReZIrUplyFxVvlIbVxPP0go8zZ2Ze/Lw1SN58hp1d5iCOAHY 2/mCspwfV9Av2fe1htgaIUg3OmOQIxWD9r23omoSfeJqCsD+e3iX7bGv/VURDqLCpE +JaebIYbEO8LiANxp019U+gST/QP+Rold09jpdYL7+PW8ik84OBmburgDFqDn/qTVH U16OHGm3sn3SXD87oteeogffNJO0VJs2OVFEJQnf6R/9sE/XtzRDws0SrL0w51/hn5 UuDyVBw2PIewjoETpeWB5WMI7NCaYpWg3m5hVmTZIJmyAPisSN88O90aNeSxIgrPwq w8ZzIhef39xuw== X-Virus-Scanned: amavisd-new at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eZ6tKB61fsos; Wed, 17 May 2023 11:08:39 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 7C6C53C020F7C; Wed, 17 May 2023 11:08:39 -0700 (PDT) Message-ID: <8e9beea2-b128-83f1-dead-2c3866e28182@cs.ucla.edu> Date: Wed, 17 May 2023 11:08:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v3] vfprintf-internal: Replace alloca with malloc. Content-Language: en-US To: Joe Simmons-Talbott , libc-alpha@sourceware.org References: <20230515185012.2768620-1-josimmon@redhat.com> From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: <20230515185012.2768620-1-josimmon@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,JMQ_SPF_NEUTRAL,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-05-15 11:50, Joe Simmons-Talbott via Libc-alpha wrote: > + args_value[cnt].pa_user = malloc (args_size[cnt]); > + if (args_value[cnt].pa_user == NULL) > + break; Shouldn't an error be returned if a printf function runs out of memory internally? Also, that function already uses a scratch buffer; why not grow the scratch buffer instead of calling malloc separately?