I tried to replicate it with this patch to the test suite:

diff --git a/resolv/tst-bug18665-tcp.c b/resolv/tst-bug18665-tcp.c
index 9b1ff0fbd8..e8e0d12bb7 100644
--- a/resolv/tst-bug18665-tcp.c
+++ b/resolv/tst-bug18665-tcp.c
@@ -47,6 +47,41 @@ response (const struct resolv_response_context *ctx,
       struct resolv_response_flags flags = {.tc = true};
       resolv_response_init (b, flags);
       resolv_response_add_question (b, qname, qclass, qtype);
+
+      if (qtype == T_A)
+        {
+          resolv_response_section (b, ns_s_an);
+          resolv_response_open_record (b, qname, qclass, T_CNAME, 600);
+          const char *alias = "somewhat.longish.cname.example";
+          resolv_response_add_name (b, alias);
+          resolv_response_close_record (b);
+
+          for (int i = 0; i < 35; ++i)
+            {
+              resolv_response_open_record (b, alias, qclass, T_A, 600);
+              const char ipv4[4] = {10, 255, 255, i};
+              resolv_response_add_data (b, ipv4, sizeof (ipv4));
+              resolv_response_close_record (b);
+            }
+        }
+      else
+        {
+          resolv_response_section (b, ns_s_ns);
+          resolv_response_open_record (b, qname, qclass, T_SOA, 600);
+          resolv_response_add_name (b, "ns1.example");
+          resolv_response_add_name (b, "hostmaster.example");
+          const uint32_t values[5] =
+            {
+              htonl (2021092901),
+              htonl (600),
+              htonl (600),
+              htonl (360000),
+              htonl (600),
+            };
+          resolv_response_add_data (b, values, sizeof (values));
+          resolv_response_close_record (b);
+        }
+
       return;
     }
 
But I do not get a crash with current master. I think we really need those 
packet captures, sorry.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1945072

Title:
  getaddrinfo crashes on negative answers after Truncated retry

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1945072/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to