]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix bug #477: unbound-anchor segfaults if EDNS is blocked.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 30 Oct 2012 15:13:53 +0000 (15:13 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 30 Oct 2012 15:13:53 +0000 (15:13 +0000)
git-svn-id: file:///svn/unbound/trunk@2778 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
smallapp/unbound-anchor.c

index 32d4fceeb5efdfb3032e484cacb029480f037b8d..cb800779b59af26be43895d414f132067cdfed98 100644 (file)
@@ -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.
index e14ca733fd7c7cf0fb919277158368952f26330b..cd846106a2ab657d516407f6e240c68a4d001c33 100644 (file)
@@ -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);