From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7896B3858D3C for ; Mon, 19 Jun 2023 14:24:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7896B3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687184655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2ULx1g9Z5YGDnN21LHBiggCCjJJ9QSBpJFbqKBvh0QA=; b=Dy78tLvaPTIWeLEHmGnRmC/79wRsZ/efhhTTdPGcvbXJ7zxmLfasaI4XV2hqOJIpaVeKxR utOyqZFKT3fqa8Nm1TmM6I6U7XFzgib3hhmTtanMnj/DaoLGb5wsaMMcH9HgwvOMhn9YXB 8hT+52kxobTmaSh/dPbw8rJOSv+9b5s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-624-GGrWMupwN-OeG7pIR1z3nw-1; Mon, 19 Jun 2023 10:24:13 -0400 X-MC-Unique: GGrWMupwN-OeG7pIR1z3nw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9CB05101A52C for ; Mon, 19 Jun 2023 14:24:12 +0000 (UTC) Received: from oak (unknown [10.22.8.210]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8863610CE7 for ; Mon, 19 Jun 2023 14:24:12 +0000 (UTC) Date: Mon, 19 Jun 2023 10:24:11 -0400 From: Joe Simmons-Talbott To: libc-alpha@sourceware.org Subject: Re: [PATCH v2] hurd: readv: Get rid of alloca Message-ID: <20230619142411.GG6392@oak> References: <20230619141325.2324846-1-josimmon@redhat.com> MIME-Version: 1.0 In-Reply-To: <20230619141325.2324846-1-josimmon@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 Mon, Jun 19, 2023 at 10:13:25AM -0400, Joe Simmons-Talbott wrote: > Replace alloca with a scratch_buffer to avoid potential stack overflows. > > Checked on i686-gnu and x86_64-linux-gnu > --- > Changes to v1: > * Add back the cleanup handler since this is a "shall occur" > cancellation point. > > sysdeps/posix/readv.c | 29 ++++++++++++----------------- > 1 file changed, 12 insertions(+), 17 deletions(-) > > diff --git a/sysdeps/posix/readv.c b/sysdeps/posix/readv.c > index 91208e9894..fab35754b0 100644 > --- a/sysdeps/posix/readv.c > +++ b/sysdeps/posix/readv.c > @@ -19,16 +19,16 @@ > #include > #include > #include > +#include > #include > #include > #include > #include > > - > static void > -ifree (char **ptrp) > +ifree (struct scratch_buffer *sbuf) > { > - free (*ptrp); > + scratch_buffer_free(sbuf); > } There are a couple of spacing issues here. I will send a v3 shortly. Thanks, Joe