[uClibc]bug in resolver code

Jay Kulpinski jskulpin at berkshire.rr.com
Sun Jan 5 20:42:30 UTC 2003


__decode_dotted() does not count the null terminating byte of 
a hostname in the DNS response.  This causes lookups to fail
if the DNS response doesn't compress domain names in the
message (like yaku-ns).

Here's the fix:



--- uClibc-0.9.16/libc/inet/resolv.c.orig       Sat Jan  4 23:29:29 2003
+++ uClibc-0.9.16/libc/inet/resolv.c    Sun Jan  5 01:15:06 2003
@@ -50,6 +50,10 @@
  *   allocation accordingly.  See MAX_ALIASES and ALIAS_DIM below.
  *   This fixes the segfault in the Python 2.2.1 socket test.
  *
+ * 04-Jan-2003 Jay Kulpinski <jskulpin at berkshire.rr.com>
+ *   Fixed __decode_dotted to count the terminating null character
+ *   in a host name.
+ *
  */

 #define __FORCE_GLIBC
@@ -307,6 +311,10 @@
                        dest[used++] = '\0';
        }

+       /* that null byte must be counted too */
+       if (measure)
+           total++;
+
        DPRINTF("Total decode len = %d\n", total);

        return total;




More information about the uClibc mailing list