diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2007-11-05 00:04:21 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2007-11-05 00:04:21 +0000 |
commit | a2b986fa722f9860a6c56bb5cc724b7e2937d1b7 (patch) | |
tree | ae6d46e2ddda2d02221479b71fbe8a44dd728c34 /contrib/sendmail/src/sm_resolve.c | |
parent | f4998c8d83fc6b77320e4da32d3d75730971e3d4 (diff) | |
download | FreeBSD-src-a2b986fa722f9860a6c56bb5cc724b7e2937d1b7.zip FreeBSD-src-a2b986fa722f9860a6c56bb5cc724b7e2937d1b7.tar.gz |
Import sendmail 8.14.2
Diffstat (limited to 'contrib/sendmail/src/sm_resolve.c')
-rw-r--r-- | contrib/sendmail/src/sm_resolve.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/sendmail/src/sm_resolve.c b/contrib/sendmail/src/sm_resolve.c index d2cf96d..035a9e5 100644 --- a/contrib/sendmail/src/sm_resolve.c +++ b/contrib/sendmail/src/sm_resolve.c @@ -46,7 +46,7 @@ # if NAMED_BIND # include "sm_resolve.h" -SM_RCSID("$Id: sm_resolve.c,v 8.34 2006/08/15 23:24:58 ca Exp $") +SM_RCSID("$Id: sm_resolve.c,v 8.35 2007/06/25 16:20:14 ca Exp $") static struct stot { @@ -168,6 +168,7 @@ parse_dns_reply(data, len) int len; { unsigned char *p; + ushort ans_cnt, ui; int status; size_t l; char host[MAXHOSTNAMELEN]; @@ -196,11 +197,15 @@ parse_dns_reply(data, len) dns_free_data(r); return NULL; } + + ans_cnt = ntohs((ushort) r->dns_r_h.ancount); + p += status; GETSHORT(r->dns_r_q.dns_q_type, p); GETSHORT(r->dns_r_q.dns_q_class, p); rr = &r->dns_r_head; - while (p < data + len) + ui = 0; + while (p < data + len && ui < ans_cnt) { int type, class, ttl, size, txtlen; @@ -210,6 +215,7 @@ parse_dns_reply(data, len) dns_free_data(r); return NULL; } + ++ui; p += status; GETSHORT(type, p); GETSHORT(class, p); |