* dnsglue.c (initparse): Skip query type and class when we lack
authorTom Yu <tlyu@mit.edu>
Tue, 19 Oct 2004 18:09:53 +0000 (18:09 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 19 Oct 2004 18:09:53 +0000 (18:09 +0000)
ns_initparse().
(krb5int_dns_nextans) [!HAVE_NS_INITPARSE]: Pass correct pointer
to dn_skipname().  Actually skip the RR name.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16831 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/dnsglue.c

index f42d83b65343e6aa98a8e96281fdb1dadb8ff898..8282280cb09dd3e1f6ab75a700136f11b26902c8 100644 (file)
@@ -1,3 +1,10 @@
+2004-10-19  Tom Yu  <tlyu@mit.edu>
+
+       * dnsglue.c (initparse): Skip query type and class when we lack
+       ns_initparse().
+       (krb5int_dns_nextans) [!HAVE_NS_INITPARSE]: Pass correct pointer
+       to dn_skipname().  Actually skip the RR name.
+
 2004-10-18  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in (TEST_PROGS): Add t_locate_kdc.
index 4bf5e0ac67479e069aa872bef73d204b05c07458..dba1b869c238b384a16947eae5291291cbcafd06 100644 (file)
@@ -238,9 +238,9 @@ initparse(struct krb5int_dns_state *ds)
        len = dn_expand(ds->ansp, (unsigned char *)ds->ansp + ds->anslen,
                        p, host, sizeof(host));
 #endif
-       if (len < 0 || !INCR_OK(ds->ansp, ds->anslen, p, len))
+       if (len < 0 || !INCR_OK(ds->ansp, ds->anslen, p, len + 4))
            return -1;
-       p += len;
+       p += len + 4;
     }
     ds->ptr = p;
     ds->nanswers = nanswers;
@@ -269,13 +269,14 @@ krb5int_dns_nextans(struct krb5int_dns_state *ds,
 
     while (ds->nanswers--) {
 #if HAVE_DN_SKIPNAME
-       len = dn_skipname(ds->ansp, (unsigned char *)ds->ansp + ds->anslen);
+       len = dn_skipname(p, (unsigned char *)ds->ansp + ds->anslen);
 #else
        len = dn_expand(ds->ansp, (unsigned char *)ds->ansp + ds->anslen,
                        p, host, sizeof(host));
 #endif
        if (len < 0 || !INCR_OK(ds->ansp, ds->anslen, p, len))
            return -1;
+       p += len;
        SAFE_GETUINT16(ds->ansp, ds->anslen, p, 2, ntype, out);
        /* Also skip 4 bytes of TTL */
        SAFE_GETUINT16(ds->ansp, ds->anslen, p, 6, nclass, out);
@@ -291,6 +292,7 @@ krb5int_dns_nextans(struct krb5int_dns_state *ds,
            ds->ptr = p + rdlen;
            return 0;
        }
+       p += rdlen;
     }
     return 0;
 out: