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 49A8F385840E for ; Wed, 5 Jul 2023 18:07:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 49A8F385840E 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=1688580428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KwcVdO+Yn7NeXgvQ7Cgd7UIebvR0OKC4qgH7tihGAHk=; b=KTd3gs28ujidKIcdB35VUq/4Vg+wgAJHW17Smp/YIvu570W0Wrrp8/l6Flw5ux1b3F2GQB /rB/dehXtQ5xho6DUEqjU2f1tx9XRHL5VInH+Pj6auO3/ltvLtwtis2cAVxaTSVV1BXihe qsj3Hm6FfjPOlye4QWzyzUlKkmPPSJo= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-298-JBnpvMOWMRSOn_H3xaY_lA-1; Wed, 05 Jul 2023 14:07:07 -0400 X-MC-Unique: JBnpvMOWMRSOn_H3xaY_lA-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-765ab532883so843187285a.0 for ; Wed, 05 Jul 2023 11:07:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688580426; x=1691172426; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KwcVdO+Yn7NeXgvQ7Cgd7UIebvR0OKC4qgH7tihGAHk=; b=dscYZ/65pjWpLlDT5Al/hBbWQfSuEU8h2f6CeugyVaE7UBW27NYd2D9ILZmPrTAl+E pBWVUJDCPUTkKAR3LUKB8WBxwtqmdvXArO3CvSxqJxDaZ6NZuW8GGSaP7qKr8fRuWjg9 cCVFg+jD5lvwlsctLirBJC1iX7ITsr/NbVFcL2ELU9ciyX/PPI7LFRQ8J7oh8ovDfstC k1dZU7RmLx47VjN4Fn0EEpCOuJ3mpMcshQEOPH7YCQiL/yIHj9/hiw0BZBlRDyd/V37h 99tADbYfekEy7VhcT07qZyITLyHV43rVdwUEWAGxHR1MgeKinEALTh3Q4sn0X0qEhpRF Y47A== X-Gm-Message-State: ABy/qLarkGKsjwwshHipp6lQg31gdFZ9FgVk9RaIx4qnxD2ybvezAeSi ftFEbGUpVLYxc58LXFqE/aMreGxvYPDbemtcUZWRPuSPA1LLaWgnvlWZrmhbjI2dBZWBTOmpR7W R2JERLu3lPlcg7f48+2UfpaEXyc/RjxGe4eaHzYD23oUngoVahymgwK9gpseJTxvv5xjoT++d1F OnW5RL X-Received: by 2002:a05:620a:1a9c:b0:767:8274:857 with SMTP id bl28-20020a05620a1a9c00b0076782740857mr6197421qkb.37.1688580426486; Wed, 05 Jul 2023 11:07:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlHm76ehZE3LKHnWD76pva1pNfaDJzYg9kXVsQt3VHCaNwc3Ob6RkEQzNdFdiJT9N6tqMkkpGQ== X-Received: by 2002:a05:620a:1a9c:b0:767:8274:857 with SMTP id bl28-20020a05620a1a9c00b0076782740857mr6197402qkb.37.1688580426212; Wed, 05 Jul 2023 11:07:06 -0700 (PDT) Received: from oak.redhat.com (c-71-206-142-238.hsd1.va.comcast.net. [71.206.142.238]) by smtp.gmail.com with ESMTPSA id n14-20020a05620a152e00b00762f37b206dsm7104821qkk.81.2023.07.05.11.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 11:07:05 -0700 (PDT) From: Joe Simmons-Talbott To: libc-alpha@sourceware.org Cc: Joe Simmons-Talbott Subject: [PATCH] resolv/res_query: Add not indicating that alloca usage is safe. Date: Wed, 5 Jul 2023 14:07:03 -0400 Message-Id: <20230705180703.1469847-1-josimmon@redhat.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.5 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,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: The buffer size is small (< 1024) and fixed sized so alloca is safe here. --- 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