From: Wouter Wijngaards Date: Tue, 30 Oct 2012 15:13:53 +0000 (+0000) Subject: - Fix bug #477: unbound-anchor segfaults if EDNS is blocked. X-Git-Tag: release-1.4.19rc1~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c3f6ca39975e8171c6bb192cda14a1a83b04c892;p=thirdparty%2Funbound.git - Fix bug #477: unbound-anchor segfaults if EDNS is blocked. git-svn-id: file:///svn/unbound/trunk@2778 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 32d4fceeb..cb800779b 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +30 October 2012: Wouter + - Fix bug #477: unbound-anchor segfaults if EDNS is blocked. + 29 October 2012: Matthijs - Fix validation for responses with both CNAME and wildcard expanded CNAME records in answer section. diff --git a/smallapp/unbound-anchor.c b/smallapp/unbound-anchor.c index e14ca733f..cd846106a 100644 --- a/smallapp/unbound-anchor.c +++ b/smallapp/unbound-anchor.c @@ -540,6 +540,11 @@ resolve_host_ip(struct ub_ctx* ctx, char* host, int port, int tp, int cl, ub_ctx_delete(ctx); exit(0); } + if(!res->havedata || res->rcode || !res->data) { + if(verb) printf("resolve %s %s: no result\n", host, + (tp==LDNS_RR_TYPE_A)?"A":"AAAA"); + return; + } for(i = 0; res->data[i]; i++) { struct ip_list* ip = RR_to_ip(tp, res->data[i], res->len[i], port);