Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1839943/?format=api
{ "id": 1839943, "url": "http://patchwork.ozlabs.org/api/patches/1839943/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20230926201717.1201494-1-josimmon@redhat.com/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20230926201717.1201494-1-josimmon@redhat.com>", "list_archive_url": null, "date": "2023-09-26T20:17:13", "name": "nss: Get rid of alloca usage in files-network's parse_line", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "acf6967891be5d13d10d73a43490ee62e0eda1be", "submitter": { "id": 86054, "url": "http://patchwork.ozlabs.org/api/people/86054/?format=api", "name": "Joe Simmons-Talbott", "email": "josimmon@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20230926201717.1201494-1-josimmon@redhat.com/mbox/", "series": [ { "id": 375002, "url": "http://patchwork.ozlabs.org/api/series/375002/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=375002", "date": "2023-09-26T20:17:13", "name": "nss: Get rid of alloca usage in files-network's parse_line", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/375002/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1839943/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1839943/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "libc-alpha@sourceware.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "libc-alpha@sourceware.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=KcFP8bRR;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org;\n envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=redhat.com", "sourceware.org; spf=pass smtp.mailfrom=redhat.com" ], "Received": [ "from server2.sourceware.org (server2.sourceware.org\n [IPv6:2620:52:3:1:0:246e:9693:128c])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4Rw9yl3LvSz26jT\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 27 Sep 2023 06:17:34 +1000 (AEST)", "from server2.sourceware.org (localhost [IPv6:::1])\n\tby sourceware.org (Postfix) with ESMTP id C3F4A3857B93\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 26 Sep 2023 20:17:30 +0000 (GMT)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTPS id 908E83858C27\n for <libc-alpha@sourceware.org>; Tue, 26 Sep 2023 20:17:22 +0000 (GMT)", "from mail-qt1-f198.google.com (mail-qt1-f198.google.com\n [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-84-1Q_O6tJeOAWbs1Z-MLxe-g-1; Tue, 26 Sep 2023 16:17:21 -0400", "by mail-qt1-f198.google.com with SMTP id\n d75a77b69052e-4180b3527c7so117053371cf.2\n for <libc-alpha@sourceware.org>; Tue, 26 Sep 2023 13:17:20 -0700 (PDT)", "from oak.redhat.com (c-71-206-142-238.hsd1.va.comcast.net.\n [71.206.142.238]) by smtp.gmail.com with ESMTPSA id\n d8-20020ac81188000000b00411fcc18cc1sm4872294qtj.64.2023.09.26.13.17.19\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 26 Sep 2023 13:17:19 -0700 (PDT)" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 908E83858C27", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1695759442;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=VIn3/IU+RGdeNWlwvSaYNZTTzFDZLoRNYLCvFXKvnrk=;\n b=KcFP8bRRIwU2Sg7rhfQD5EvCEIxAptxMdw3RIJW3KqhoJSoWjmyfTiiqgdNLjmW//xl3pz\n E2pK2JPgooiOJXMC3KUs72ZO4uRbzmFCj4rv509ZmwcKZ2wAlHEEp48e7Jk0FD2z4x7Uyg\n wC6hIt34c5DJuE7xyfj+ktvKJ79D5/g=", "X-MC-Unique": "1Q_O6tJeOAWbs1Z-MLxe-g-1", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1695759440; x=1696364240;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=VIn3/IU+RGdeNWlwvSaYNZTTzFDZLoRNYLCvFXKvnrk=;\n b=XB81GkniSLGaKqJNdzyUsDq4AeMg63sy0EBeGghzgU9tpyskx9sY1Q0Cu03rfjdu8G\n wROsM0J85wA4XHUpXzzvY7I+apzDBBRtOXElhtp96BUPBusFRcgNYfUyma+5bEZYmqh+\n 1ET3G76eJl0EBUjETAImpsKMmNLYrUsIYKvWTn+rcrLZe0NQSezeoB1eQ+EDTe34ZpGM\n rS8LWkCUIke2UavJYE2bpGytMkstPfHtS3tTK298AD663SlU0gRsnwAAc2vBYomWROBo\n 6BExqndM04qkgf7wL4GSQbi9BLgt0Ob9+M6m3N1KBnA+ndq4Q66iE1bVVIZ/L+xXplR9\n kgaw==", "X-Gm-Message-State": "AOJu0YxZsbsDDFEV1fEyquP73+8PdZ5FrOCCestORTUPhB9t+4rscSDS\n 8LXbiVlq7URea0uSM4Mvg8Rn6e7gxMA0mWVjBX7R3bi0YhjNMrrr0vOWj9yI6ETUgwlfelhSFX8\n TdvYQ/8d45i1/pEb3yWE61SFDOsxoog+4+/vpZN9Fz8x+3d4N5bc6xD5uHA8tp6+5IbxKpsH3oo\n hBhEWu", "X-Received": [ "by 2002:ac8:5b09:0:b0:417:fd7e:2154 with SMTP id\n m9-20020ac85b09000000b00417fd7e2154mr15164510qtw.9.1695759440324;\n Tue, 26 Sep 2023 13:17:20 -0700 (PDT)", "by 2002:ac8:5b09:0:b0:417:fd7e:2154 with SMTP id\n m9-20020ac85b09000000b00417fd7e2154mr15164495qtw.9.1695759440089;\n Tue, 26 Sep 2023 13:17:20 -0700 (PDT)" ], "X-Google-Smtp-Source": "\n AGHT+IFCREQgLzfsL1HC+KKvFgvNBLymZNU37+MwzGk++LjME5KN9hO7ynFJZtwsJkben3nlrUil6g==", "From": "Joe Simmons-Talbott <josimmon@redhat.com>", "To": "libc-alpha@sourceware.org", "Cc": "Joe Simmons-Talbott <josimmon@redhat.com>", "Subject": "[PATCH] nss: Get rid of alloca usage in files-network's parse_line", "Date": "Tue, 26 Sep 2023 16:17:13 -0400", "Message-ID": "<20230926201717.1201494-1-josimmon@redhat.com>", "X-Mailer": "git-send-email 2.41.0", "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.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH,\n DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0,\n RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,\n SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6", "X-Spam-Checker-Version": "SpamAssassin 3.4.6 (2021-04-09) on\n server2.sourceware.org", "X-BeenThere": "libc-alpha@sourceware.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Libc-alpha mailing list <libc-alpha.sourceware.org>", "List-Unsubscribe": "<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>", "List-Archive": "<https://sourceware.org/pipermail/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-request@sourceware.org?subject=help>", "List-Subscribe": "<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>", "Errors-To": "libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org" }, "content": "Replace alloca usage with a scratch_buffer.\n---\n nss/nss_files/files-network.c | 10 +++++++++-\n 1 file changed, 9 insertions(+), 1 deletion(-)", "diff": "diff --git a/nss/nss_files/files-network.c b/nss/nss_files/files-network.c\nindex c010d21fde..58072ca6b4 100644\n--- a/nss/nss_files/files-network.c\n+++ b/nss/nss_files/files-network.c\n@@ -19,6 +19,7 @@\n #include <netinet/in.h>\n #include <arpa/inet.h>\n #include <netdb.h>\n+#include <scratch_buffer.h>\n #include <stdint.h>\n #include <nss.h>\n \n@@ -37,6 +38,8 @@ LINE_PARSER\n char *addr;\n char *cp;\n int n = 1;\n+ struct scratch_buffer sbuf;\n+ scratch_buffer_init (&sbuf);\n \n STRING_FIELD (result->n_name, isspace, 1);\n \n@@ -58,7 +61,11 @@ LINE_PARSER\n }\n if (n < 4)\n {\n- char *newp = (char *) alloca (strlen (addr) + (4 - n) * 2 + 1);\n+ if (!scratch_buffer_set_array_size (\n+ &sbuf, 1, strlen (addr) + (4 - n) * 2 + 1))\n+ return -1;\n+\tchar *newp = sbuf.data;\n+\n cp = stpcpy (newp, addr);\n do\n \t {\n@@ -71,6 +78,7 @@ LINE_PARSER\n }\n result->n_net = __inet_network (addr);\n result->n_addrtype = AF_INET;\n+ scratch_buffer_free (&sbuf);\n \n })\n \n", "prefixes": [] }