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 7dde69c..d0ee295 100644 (file)
@@ -494,7 +494,7 @@ static int query_submit(Tcl_Interp *ip,
   
   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);
index 81af378..c859f29 100644 (file)
@@ -1,5 +1,9 @@
 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'.