From 26d825e9680a00910a1e3330dc81f14138c2785a Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Tue, 19 Oct 2004 18:09:53 +0000 Subject: [PATCH] * 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16831 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 7 +++++++ src/lib/krb5/os/dnsglue.c | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index f42d83b65..8282280cb 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,10 @@ +2004-10-19 Tom Yu + + * 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 * Makefile.in (TEST_PROGS): Add t_locate_kdc. diff --git a/src/lib/krb5/os/dnsglue.c b/src/lib/krb5/os/dnsglue.c index 4bf5e0ac6..dba1b869c 100644 --- a/src/lib/krb5/os/dnsglue.c +++ b/src/lib/krb5/os/dnsglue.c @@ -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: -- 2.26.2