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 C3681385772B for ; Thu, 10 Aug 2023 13:46:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C3681385772B 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=1691675218; 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=6SwzO+TOzpXzBuBHSzqQ1yzbsVQqkCSo6aaDzp/ck/g=; b=dyQ50r/eNpTRNQwYkxLOZhB7Z7VqrRz+ElOFA0vuN1jakw5oxhqkkyJbYJa6b4SPrOTPWL A+dfmYaZHwrtsKXECpnDhdviLvMMUp3xpt1XjrJxOhx9SwYYqt8BUrwJG6BQX7qRqGm5wO M++cXv5M8LcK75HacvsjdxEr//u/RK4= 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-596-4sDwe62qM_yBCss8oXNGJg-1; Thu, 10 Aug 2023 09:46:57 -0400 X-MC-Unique: 4sDwe62qM_yBCss8oXNGJg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0D0B791C7C2 for ; Thu, 10 Aug 2023 13:46:57 +0000 (UTC) Received: from oak (unknown [10.22.33.199]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ECC4D492B0F for ; Thu, 10 Aug 2023 13:46:56 +0000 (UTC) Date: Thu, 10 Aug 2023 09:46:55 -0400 From: Joe Simmons-Talbott To: libc-alpha@sourceware.org Subject: Re: [PATCH] resolv/res_query: Add note indicating that alloca usage is safe. Message-ID: <20230810134655.GK3849957@oak> References: <20230705181341.1470594-1-josimmon@redhat.com> MIME-Version: 1.0 In-Reply-To: <20230705181341.1470594-1-josimmon@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP 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 Wed, Jul 05, 2023 at 02:13:41PM -0400, Joe Simmons-Talbott wrote: > The buffer size is small (< 1024) and fixed sized so alloca is safe > here. Ping. Thanks, Joe > --- > resolv/res_query.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/resolv/res_query.c b/resolv/res_query.c > index 049de91b95..0e0e7be624 100644 > --- a/resolv/res_query.c > +++ b/resolv/res_query.c > @@ -117,6 +117,7 @@ __res_context_query (struct resolv_context *ctx, const char *name, > int n, use_malloc = 0; > > size_t bufsize = (type == T_QUERY_A_AND_AAAA ? 2 : 1) * QUERYSIZE; > + /* alloca is safe here since bufsize < 1024 and fixed sized. */ > u_char *buf = alloca (bufsize); > u_char *query1 = buf; > int nquery1 = -1; > -- > 2.39.2 >