chiark / gitweb /
adns: Use proper variable for aftry array size calculation
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 18 Aug 2018 21:29:33 +0000 (22:29 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 18 Aug 2018 21:30:56 +0000 (22:30 +0100)
GCC spots this bug, causing the build to fail with a warning.
Closes:#891544.

The effect is that for reverse lookups only IPv4 would work.
IPv6 should work now.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
adns/adns.c
debian/changelog

index 7dde69cfc2782b1ff039160c1e827ef49f130bd6..d0ee2955b94e09e26c36acde087faf81212173fd 100644 (file)
@@ -494,7 +494,7 @@ static int query_submit(Tcl_Interp *ip,
   
   if (op.reverseany || (op.sflags & oisf_reverse)) {
     const int *af;
   
   if (op.reverseany || (op.sflags & oisf_reverse)) {
     const int *af;
-    for (af=aftry; af < af + sizeof(af)/sizeof(*af); af++) {
+    for (af=aftry; af < af + sizeof(aftry)/sizeof(*aftry); af++) {
       memset(&sa,0,sizeof(sa));
       sa.sa_family= *af;
       r= inet_pton(*af,domain,&sa);
       memset(&sa,0,sizeof(sa));
       sa.sa_family= *af;
       r= inet_pton(*af,domain,&sa);
index 81af3786333e469bd2561541fba87a5a29d276d2..c859f2912e86ad8a9c067b86018cb995e5913bec 100644 (file)
@@ -1,5 +1,9 @@
 chiark-tcl (1.2.2~) unstable; urgency=medium
 
 chiark-tcl (1.2.2~) unstable; urgency=medium
 
+  adns:
+  * Fix IPv6 PTR (reverse) lookups, and compilation with GCC-8.
+    Closes:#891544.
+
   tcmdifgen:
   * Turn on warnings and `use strict' and fix everything.
   * Replace deprecated `use IO;' with `use IO::File'.
   tcmdifgen:
   * Turn on warnings and `use strict' and fix everything.
   * Replace deprecated `use IO;' with `use IO::File'.