Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2231097/?format=api
{ "id": 2231097, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2231097/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/c0191a0afbfd6837bc7bc1b2695eaacf3e41b0fe.1777546194.git.fweimer@redhat.com/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<c0191a0afbfd6837bc7bc1b2695eaacf3e41b0fe.1777546194.git.fweimer@redhat.com>", "list_archive_url": null, "date": "2026-04-30T10:52:18", "name": "[5/5] resolv: Add test case tst-ns_sprintrr (bug 34033, bug 34069)", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "1799225c3993774ca18419a8b7ca028a6198c85a", "submitter": { "id": 14312, "url": "http://patchwork.ozlabs.org/api/1.2/people/14312/?format=api", "name": "Florian Weimer", "email": "fweimer@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/c0191a0afbfd6837bc7bc1b2695eaacf3e41b0fe.1777546194.git.fweimer@redhat.com/mbox/", "series": [ { "id": 502273, "url": "http://patchwork.ozlabs.org/api/1.2/series/502273/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=502273", "date": "2026-04-30T10:51:34", "name": "Fixes for CVE-2026-5435, CVE-2026-6238", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/502273/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2231097/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2231097/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=Z6Nw4NkH;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)", "sourceware.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=Z6Nw4NkH", "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com", "sourceware.org; spf=pass smtp.mailfrom=redhat.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\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 4g5rfs2Dyqz1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 20:55:17 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 722D74310D56\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 10:55:15 +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 ESMTP id EAF9F436F7C9\n for <libc-alpha@sourceware.org>; Thu, 30 Apr 2026 10:52:23 +0000 (GMT)", "from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-190-3Emgo2j1MgOMenideZp9Ag-1; Thu,\n 30 Apr 2026 06:52:22 -0400", "from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 31AC51800282\n for <libc-alpha@sourceware.org>; Thu, 30 Apr 2026 10:52:21 +0000 (UTC)", "from fweimer-oldenburg.csb.redhat.com (unknown [10.44.48.4])\n by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id 7B8CC30001A1\n for <libc-alpha@sourceware.org>; Thu, 30 Apr 2026 10:52:20 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 722D74310D56", "OpenDKIM Filter v2.11.0 sourceware.org EAF9F436F7C9" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org EAF9F436F7C9", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org EAF9F436F7C9", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777546344; cv=none;\n b=EoVzgf4nD6qe0T4BuZCmya+YhqkljBVf5J0IYtOKac6Kciq2nNgqzhi1uapB99WGkjGEJt3ZWR16kkAZoescz5yur/FElThPa+W0HnldRjITRLr48HREbzBUiZwjaLMDyjfMDdFdWEpt1ylr4mcnWmTiD8bzIplh+WIGVwDKrk8=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777546344; c=relaxed/simple;\n bh=LT01Xs+hrYpVCpZoJ83f25VMS37v9yHYJPkw+FQ/cNI=;\n h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version;\n b=Fc18ffETT7jK70l+uvlF5da945c4cc2Ccn4z+arfUxBR8q/WGkrMuGBHBD2qMrTHSdQh00T7iZmT6eHmGXT+/h+VSyW5sWtp9sKRd6gVIfGQ0shKB5sgMAY3OAqZgUSorPN3jkDdWdCBCUZCEByvje/TtJpWJ9ojHXtw6udCsIw=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777546343;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=ofCM+f/Qq/9LQXz+JCIpgh5E+DBdKM8tX9UyXCGRU68=;\n b=Z6Nw4NkHZ4vuWqICgZZMcGCFd57qlj+kVZ/rnIglj8ynZxoJmpmeNoXYR7xk19hDO1MSK0\n X4iFcn4wzssNR+bNERB1aXI4ZS4b3FrXVQIbCqYXoFD9EmDas8IO17oeGdmDC3vDdR9S3v\n C4vFpLs5waimLQB8XYoAmcPyHcVTK2c=", "X-MC-Unique": "3Emgo2j1MgOMenideZp9Ag-1", "X-Mimecast-MFC-AGG-ID": "3Emgo2j1MgOMenideZp9Ag_1777546341", "From": "Florian Weimer <fweimer@redhat.com>", "To": "libc-alpha@sourceware.org", "Subject": "[PATCH 5/5] resolv: Add test case tst-ns_sprintrr (bug 34033, bug\n 34069)", "In-Reply-To": "<cover.1777546194.git.fweimer@redhat.com>", "Message-ID": "\n <c0191a0afbfd6837bc7bc1b2695eaacf3e41b0fe.1777546194.git.fweimer@redhat.com>", "References": "<cover.1777546194.git.fweimer@redhat.com>", "X-From-Line": "c0191a0afbfd6837bc7bc1b2695eaacf3e41b0fe Mon Sep 17 00:00:00 2001", "Date": "Thu, 30 Apr 2026 12:52:18 +0200", "User-Agent": "Gnus/5.13 (Gnus v5.13)", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.4", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "oASdVMfasjB88yEtpGejlYTJDJPy0bdQW_4Mg-vqnGY_1777546341", "X-Mimecast-Originator": "redhat.com", "Content-Type": "text/plain", "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": "This test case covers both input buffer overreads and output buffer\noverflows. It should systematically cover these issues.\n\nI used code auto-generation for updating the test expectations for\ntruncated RDATA in TXT, ISDN, CERT records, after writing the rest\nof the test by hand.\n\nAssisted-by: LLM\n---\n resolv/Makefile | 2 +\n resolv/tst-ns_sprintrr.c | 322 +++++++++++++++++++++++++++++++++++++++\n 2 files changed, 324 insertions(+)\n create mode 100644 resolv/tst-ns_sprintrr.c", "diff": "diff --git a/resolv/Makefile b/resolv/Makefile\nindex 971608eff5..4b61d2ce98 100644\n--- a/resolv/Makefile\n+++ b/resolv/Makefile\n@@ -108,6 +108,7 @@ tests += \\\n tst-ns_name \\\n tst-ns_name_compress \\\n tst-ns_name_pton \\\n+ tst-ns_sprintrr \\\n tst-res_hconf_reorder \\\n tst-res_hnok \\\n tst-resolv-aliases \\\n@@ -338,5 +339,6 @@ $(objpfx)tst-ns_name: $(objpfx)libresolv.so\n $(objpfx)tst-ns_name.out: tst-ns_name.data\n $(objpfx)tst-ns_name_compress: $(objpfx)libresolv.so\n $(objpfx)tst-ns_name_pton: $(objpfx)libresolv.so\n+$(objpfx)tst-ns_sprintrr: $(objpfx)libresolv.so\n $(objpfx)tst-res_hnok: $(objpfx)libresolv.so\n $(objpfx)tst-p_secstodate: $(objpfx)libresolv.so\ndiff --git a/resolv/tst-ns_sprintrr.c b/resolv/tst-ns_sprintrr.c\nnew file mode 100644\nindex 0000000000..522d835fe6\n--- /dev/null\n+++ b/resolv/tst-ns_sprintrr.c\n@@ -0,0 +1,322 @@\n+/* Tests for the ns_sprintrr function.\n+ Copyright (C) 2026 Free Software Foundation, Inc.\n+ This file is part of the GNU C Library.\n+\n+ The GNU C Library is free software; you can redistribute it and/or\n+ modify it under the terms of the GNU Lesser General Public\n+ License as published by the Free Software Foundation; either\n+ version 2.1 of the License, or (at your option) any later version.\n+\n+ The GNU C Library is distributed in the hope that it will be useful,\n+ but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+ Lesser General Public License for more details.\n+\n+ You should have received a copy of the GNU Lesser General Public\n+ License along with the GNU C Library; if not, see\n+ <https://www.gnu.org/licenses/>. */\n+\n+#include <arpa/nameser.h>\n+\n+#include <alloc_buffer.h>\n+#include <arpa/inet.h>\n+#include <libc-diag.h>\n+#include <stdbool.h>\n+#include <string.h>\n+#include <support/check.h>\n+#include <support/next_to_fault.h>\n+\n+/* Regions that test_one_record uses for input and output. */\n+static struct support_next_to_fault ntf_in;\n+static struct support_next_to_fault ntf_out;\n+\n+/* This is used by test_one_record to construct the packet. */\n+static const char packet_prefix[] =\n+ /* DNS response with one question, one answer record. */\n+ \"AA\\x81\\x80\\0\\1\\0\\1\\0\\0\\0\\0\"\n+ /* Question: www.example.org/IN/ANY. */\n+ \"\\3www\\7example\\3org\\0\\0\\xff\\0\\1\"\n+ /* Response: compression reference. */\n+ \"\\xc0\\x0c\";\n+\n+/* Use ns_sprintrr to format a DNS record (starting with\n+ packet_prefix) of type RTYPE, with a record payload of RDATALEN\n+ bytes starting at RDATA. Check successful formatting against\n+ EXPECTED. Try various truncated input and output buffers to catch\n+ overreads and buffer overflows, using ntf_in and ntf_out above. */\n+static void\n+test_one_record (uint16_t rtype, const char *rdata, size_t rdatalen,\n+ const char *expected)\n+{\n+ struct rr_header\n+ {\n+ uint16_t typ;\n+ uint16_t cls;\n+ uint32_t ttl;\n+ uint16_t rdatalen;\n+ uint16_t pad;\n+ } hdr =\n+ {\n+ .typ = htons (rtype),\n+ .cls = htons (ns_c_in),\n+ .ttl = htonl (86400), /* One day. */\n+ .rdatalen = htons (rdatalen),\n+ };\n+ size_t hdrlen = offsetof (struct rr_header, pad);\n+ TEST_COMPARE (hdrlen, 10);\n+\n+ /* Construct the packet from packet_prefix, hdr, and rdata. */\n+ char packet[512];\n+ size_t packetlen;\n+ {\n+ struct alloc_buffer buf = alloc_buffer_create (packet, sizeof (packet));\n+ alloc_buffer_copy_bytes (&buf, packet_prefix, sizeof (packet_prefix) - 1);\n+ alloc_buffer_copy_bytes (&buf, &hdr, hdrlen);\n+ alloc_buffer_copy_bytes (&buf, rdata, rdatalen);\n+ packetlen = sizeof (packet) - alloc_buffer_size (&buf);\n+ }\n+\n+ /* Parse the record. */\n+ ns_msg msg;\n+ TEST_COMPARE (ns_initparse ((unsigned char *) packet, packetlen, &msg), 0);\n+ ns_rr rr;\n+ TEST_COMPARE (ns_parserr (&msg, ns_s_an, 0, &rr), 0);\n+\n+ /* Try sizes up to this limit. Go a bit beyond the expected size to\n+ check for errors. */\n+ size_t max_result_size = strlen (expected) + 16;\n+\n+ bool success = false;\n+ for (size_t result_size = 1; result_size <= max_result_size; ++result_size)\n+ {\n+ char *result_start = ntf_out.buffer + ntf_out.length - result_size;\n+ memset (result_start, 'X', result_size);\n+\n+ /* ns_sprintrr was deprecated in 2.34. */\n+ DIAG_PUSH_NEEDS_COMMENT;\n+ DIAG_IGNORE_NEEDS_COMMENT (4.9, \"-Wdeprecated-declarations\");\n+ int ret = ns_sprintrr (&msg, &rr, NULL, NULL, result_start, result_size);\n+ DIAG_POP_NEEDS_COMMENT;\n+\n+ if (ret > 0)\n+ {\n+ TEST_COMPARE_STRING (result_start, expected);\n+ TEST_COMPARE (ret, strlen (expected));\n+ success = true;\n+ }\n+ else\n+ {\n+ TEST_VERIFY (!success);\n+ TEST_COMPARE (ret, -1);\n+ }\n+ }\n+ TEST_VERIFY (success);\n+\n+ /* Test with truncated RDATA. */\n+ for (size_t rdata_size = 0; rdata_size <= rdatalen; ++rdata_size)\n+ {\n+ size_t truncated_packet_size = packetlen - rdatalen + rdata_size;\n+ char *packet_start\n+ = ntf_in.buffer + ntf_in.length - truncated_packet_size;\n+ memcpy (packet_start, packet, truncated_packet_size);\n+ /* Patch in the updated RDATA length field. */\n+ uint16_t new_rdatalen = htons (rdata_size);\n+ memcpy (packet_start + truncated_packet_size - rdata_size - 2,\n+ &new_rdatalen, 2);\n+\n+ ns_msg msg;\n+ TEST_COMPARE (ns_initparse ((unsigned char *) packet_start,\n+ truncated_packet_size, &msg), 0);\n+ ns_rr rr;\n+ TEST_COMPARE (ns_parserr (&msg, ns_s_an, 0, &rr), 0);\n+\n+ size_t result_size = strlen (expected) + 1;\n+ char *result_start = ntf_out.buffer + ntf_out.length - result_size;\n+ memset (result_start, 'X', result_size);\n+\n+ /* ns_sprintrr was deprecated in 2.34. */\n+ DIAG_PUSH_NEEDS_COMMENT;\n+ DIAG_IGNORE_NEEDS_COMMENT (4.9, \"-Wdeprecated-declarations\");\n+ int ret = ns_sprintrr (&msg, &rr, NULL, NULL, result_start, result_size);\n+ DIAG_POP_NEEDS_COMMENT;\n+\n+ /* This flag indicates whether the output is syntactically\n+ correct. In some cases, truncation may still yield a valid\n+ payload. */\n+ bool broken = rdata_size < rdatalen;\n+ switch (rtype)\n+ {\n+ case ns_t_wks:\n+ /* WKS records use all trailing bytes for the port bitmap. */\n+ broken = rdata_size < 5;\n+ break;\n+ case ns_t_nsap:\n+ /* Uses all bytes that are available. */\n+ broken = false;\n+ break;\n+ case ns_t_txt:\n+ /* Truncation produces a valid payload if it occurs right\n+ after a complete string in the TXT payload. */\n+ broken = false;\n+ for (size_t pos = 0; pos < rdata_size; )\n+ {\n+ unsigned int slen = rdata[pos] & 0xff;\n+ if (pos + 1 + slen > rdata_size)\n+ {\n+ broken = true;\n+ break;\n+ }\n+ pos += 1 + slen;\n+ }\n+ break;\n+ case ns_t_isdn:\n+ /* The second field is optional. If it is present, it must\n+ not be truncated. */\n+ broken = rdata_size < 6 || (rdata_size > 6 && rdata_size < rdatalen);\n+ break;\n+ case ns_t_cert:\n+ /* The 5-byte header is sufficient. Any available trailing\n+ data is base64-encoded. */\n+ broken = rdata_size < 5;\n+ break;\n+ case ns_t_a6:\n+ /* The first A6 subtest contains a trailing domain name,\n+ which is ignored and not formatted. */\n+ if (rdata_size > 0 && rdata[0] == 0)\n+ broken = rdata_size < 17;\n+ break;\n+ }\n+\n+ if (broken)\n+ {\n+ if (strstr (result_start, \"RR format error\") != NULL)\n+ /* No further checks if an error indicator has been added\n+ to the output. */\n+ ;\n+ /* TKEY and TSIG implementations are incomplete. */\n+ else if (rtype != ns_t_tkey && rtype != ns_t_tsig)\n+ TEST_COMPARE (ret, -1);\n+ }\n+ else\n+ TEST_VERIFY (ret > 0);\n+ }\n+}\n+\n+static int\n+do_test (void)\n+{\n+ ntf_in = support_next_to_fault_allocate (512);\n+ ntf_out = support_next_to_fault_allocate (256);\n+\n+#define T(rtype, rdata, expected) \\\n+ test_one_record (rtype, rdata, sizeof (rdata) - 1, expected)\n+ T (ns_t_a, \"\\xc0\\0\\2\\1\", \"www.example.org.\\t1D IN A\\t\\t192.0.2.1\");\n+ T (ns_t_cname, \"\\4www1\\4prod\\xc0\\x10\",\n+ \"www.example.org.\\t1D IN CNAME\\twww1.prod.example.org.\");\n+ T (ns_t_hinfo, \"\\5first\\6second\",\n+ \"www.example.org.\\t1D IN HINFO\\t\\\"first\\\" \\\"second\\\"\");\n+ T (ns_t_isdn, \"\\5first\\6second\",\n+ \"www.example.org.\\t1D IN ISDN\\t\\\"first\\\" \\\"second\\\"\");\n+ /* Bug: Extra space at the end in the text representation of ISDN RRs. */\n+ T (ns_t_isdn, \"\\5first\", \"www.example.org.\\t1D IN ISDN\\t\\\"first\\\" \");\n+ T (ns_t_soa,\n+ \"\\2ns\\xc0\\x10\\12hostmaster\\xc0\\x10\"\n+ \"\\0\\0\\0\\1\\0\\0\\0\\2\\0\\0\\0\\3\\0\\0\\0\\4\\0\\0\\0\\5\",\n+ \"www.example.org.\\t1D IN SOA\\tns.example.org. hostmaster.example.org. (\\n\"\n+ \"\\t\\t\\t\\t\\t1\\t\\t; serial\\n\"\n+ \"\\t\\t\\t\\t\\t2S\\t\\t; refresh\\n\"\n+ \"\\t\\t\\t\\t\\t3S\\t\\t; retry\\n\"\n+ \"\\t\\t\\t\\t\\t4S\\t\\t; expiry\\n\"\n+ \"\\t\\t\\t\\t\\t5S )\\t\\t; minimum\\n\");\n+ T (ns_t_mx, \"\\0\\xa\\2mx\\xc0\\x10\",\n+ \"www.example.org.\\t1D IN MX\\t10 mx.example.org.\");\n+ T (ns_t_px, \"\\0\\xa\\3px1\\xc0\\x10\\3px2\\xc0\\x10\",\n+ \"www.example.org.\\t1D IN PX\\t10 px1.example.org. px2.example.org.\");\n+ T (ns_t_x25, \"\\4X.25\",\n+ \"www.example.org.\\t1D IN X25\\t\\\"X.25\\\"\");\n+ T (ns_t_txt, \"\\1A\\2BC\\3DEF\",\n+ \"www.example.org.\\t1D IN TXT\\t\\\"A\\\" \\\"BC\\\" \\\"DEF\\\"\");\n+ T (ns_t_nsap, \"\",\n+ \"www.example.org.\\t1D IN NSAP\\t\");\n+ T (ns_t_nsap, \"\\1\",\n+ \"www.example.org.\\t1D IN NSAP\\t01\");\n+ T (ns_t_nsap, \"\\1\\2\",\n+ \"www.example.org.\\t1D IN NSAP\\t01.02\");\n+ T (ns_t_nsap, \"\\1\\2\\3\",\n+ \"www.example.org.\\t1D IN NSAP\\t01.0203\");\n+ T (ns_t_nsap, \"\\1\\2\\3\\4\",\n+ \"www.example.org.\\t1D IN NSAP\\t01.0203.04\");\n+ T (ns_t_nsap,\n+ \"\\1\\2\\3\\4\\5\\6\\7\\10\\11\\12\\13\\14\\15\\16\\17\\20\\21\\22\\23\\24\\25\\26\\27\\30\\31\\32\"\n+ \"\\33\\34\\35\\36\\37\\40\\41\\42\\43\\44\\45\\46\\47\\50\\51\\52\\53\\54\\55\\56\\57\\60\\61\"\n+ \"\\62\\63\\64\\65\\66\\67\\70\\71\\72\\73\\74\\75\\76\\77\\100\\101\\102\\103\\104\\105\\106\"\n+ \"\\107\\110\\111\\112\\113\\114\\115\\116\\117\\120\\121\\122\\123\\124\\125\\126\\127\"\n+ \"\\130\\131\\132\\133\\134\\135\\136\\137\\140\\141\\142\\143\\144\\145\\146\\147\\150\"\n+ \"\\151\\152\\153\\154\\155\\156\\157\\160\\161\\162\\163\\164\\165\\166\\167\\170\\171\"\n+ \"\\172\\173\\174\\175\\176\\177\\200\\201\\202\\203\\204\\205\\206\\207\\210\\211\\212\"\n+ \"\\213\\214\\215\\216\\217\\220\\221\\222\\223\\224\\225\\226\\227\\230\\231\\232\\233\"\n+ \"\\234\\235\\236\\237\\240\\241\\242\\243\\244\\245\\246\\247\\250\\251\\252\\253\\254\"\n+ \"\\255\\256\\257\\260\\261\\262\\263\\264\\265\\266\\267\\270\\271\\272\\273\\274\\275\"\n+ \"\\276\\277\\300\\301\\302\\303\\304\\305\\306\\307\\310\\311\\312\\313\\314\\315\\316\"\n+ \"\\317\\320\\321\\322\\323\\324\\325\\326\\327\\330\\331\\332\\333\\334\\335\\336\\337\"\n+ \"\\340\\341\\342\\343\\344\\345\\346\\347\\350\\351\\352\\353\\354\\355\\356\\357\\360\"\n+ \"\\361\\362\\363\\364\\365\\366\\367\\370\\371\\372\\373\\374\\375\\376\\377\",\n+ \"www.example.org.\\t1D IN NSAP\\t\"\n+ \"01.0203.0405.0607.0809.0A0B.0C0D.0E0F.1011.1213.1415.1617.1819.1A1B\"\n+ \".1C1D.1E1F.2021.2223.2425.2627.2829.2A2B.2C2D.2E2F.3031.3233.3435.3637\"\n+ \".3839.3A3B.3C3D.3E3F.4041.4243.4445.4647.4849.4A4B.4C4D.4E4F.5051.5253\"\n+ \".5455.5657.5859.5A5B.5C5D.5E5F.6061.6263.6465.6667.6869.6A6B.6C6D.6E6F\"\n+ \".7071.7273.7475.7677.7879.7A7B.7C7D.7E7F.8081.8283.8485.8687.8889.8A8B\"\n+ \".8C8D.8E8F.9091.9293.9495.9697.9899.9A9B.9C9D.9E9F.A0A1.A2A3.A4A5.A6A7\"\n+ \".A8A9.AAAB.ACAD.AEAF.B0B1.B2B3.B4B5.B6B7.B8B9.BABB.BCBD.BEBF.C0C1.C2C3\"\n+ \".C4C5.C6C7.C8C9.CACB.CCCD.CECF.D0D1.D2D3.D4D5.D6D7.D8D9.DADB.DCDD.DEDF\"\n+ \".E0E1.E2E3.E4E5.E6E7.E8E9.EAEB.ECED.EEEF.F0F1.F2F3.F4F5.F6F7.F8F9.FAFB\"\n+ \".FCFD.FEFF\");\n+ T (ns_t_aaaa, \"\\x20\\x01\\x0d\\xb8\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\x12\\x34\",\n+ \"www.example.org.\\t1D IN AAAA\\t2001:db8::1234\");\n+ /* Example from RFC 1876. The loc_ntoa format is different from the\n+ official text representation. */\n+ T (ns_t_loc,\n+ \"\\000\\063\\026\\023\\211\\027\\055\\320\\160\\276\\025\\360\\000\\230\\215\\040\",\n+ \"www.example.org.\\t1D IN LOC\"\n+ \"\\t42 21 54.000 N 71 06 18.000 W -24.00m 30.00m 10000.00m 10.00m\");\n+ T (ns_t_naptr,\n+ \"\\0\\1\\0\\2\\5flags\\7service\\2.*\\5naptr\\xc0\\x10\",\n+ \"www.example.org.\\t1D IN NAPTR\\t1 2 \\\"flags\\\" \\\"service\\\" \\\".*\\\"\"\n+ \" naptr.example.org.\");\n+ T (ns_t_srv,\n+ \"\\0\\1\\0\\2\\0\\x50\\4www1\\xc0\\x10\",\n+ \"www.example.org.\\t1D IN SRV\\t1 2 80 www1.example.org.\");\n+ T (ns_t_rp, \"\\3rp1\\xc0\\x10\\3rp2\\xc0\\x10\",\n+ \"www.example.org.\\t1D IN RP\\trp1.example.org. rp2.example.org.\");\n+ T (ns_t_wks, \"\\xc0\\0\\2\\1\\6\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\200\",\n+ \"www.example.org.\\t1D IN WKS\\t192.0.2.1 6 ( \\n\\t\\t\\t\\t80 )\");\n+ T (ns_t_cert, \"\\0\\1\\x04\\xd2\\0blob\",\n+ \"www.example.org.\\t1D IN CERT\\t1 1234 0 YmxvYg==\");\n+ /* Bug: TKEY output is incomplete. */\n+ T (ns_t_tkey, \"\\4algo\\0\\0\\0\\0\\1\\0\\0\\0\\2\\0\\3\\0\\4\"\n+ \"\\0\\5\\xa1\\xa2\\xa3\\xa4\\xa5\\0\\3\\xb1\\xb2\\xb3\",\n+ \"www.example.org.\\t1D IN 249\\talgo. 1 2 3 4 5 \");\n+ /* Bug: Not implemented properly. */\n+ T (ns_t_tsig, \"\\4algo\\0\"\n+ \"\\0\\20\\xdd\\xcd\\x64\\x10\\xe9\\x21\\x34\\x1a\\x8e\\xe0\\xa1\\x9a\\x30\\xfc\\x3b\\xd1\"\n+ \"\\0\\2\\0\\3\\0\\5other\",\n+ \"www.example.org.\\t1D IN TSIG\\talgo.\");\n+ T (ns_t_a6,\n+ \"\\0\\x20\\x01\\x0d\\xb8\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\x12\\x34\\6prefix\\xc0\\x10\",\n+ \"www.example.org.\\t1D IN 38\\t0 2001:db8::1234\");\n+ T (ns_t_a6,\n+ \"\\0\\x20\\x01\\x0d\\xb8\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\x12\\x34\",\n+ \"www.example.org.\\t1D IN 38\\t0 2001:db8::1234\");\n+ T (ns_t_a6, \"\\200\\6prefix\\xc0\\x10\",\n+ \"www.example.org.\\t1D IN 38\\t128 prefix.example.org.\");\n+ T (ns_t_a6, \"\\x20\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\x12\\x34\\6prefix\\xc0\\x10\",\n+ \"www.example.org.\\t1D IN 38\\t32 ::1234 prefix.example.org.\");\n+#undef T\n+\n+ support_next_to_fault_free (&ntf_in);\n+ support_next_to_fault_free (&ntf_out);\n+ return 0;\n+}\n+\n+#include <support/test-driver.c>\n", "prefixes": [ "5/5" ] }