resolved: allow DnsAnswer objects with no space for RRs
authorLennart Poettering <lennart@poettering.net>
Mon, 18 May 2015 21:38:47 +0000 (23:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 May 2015 21:38:47 +0000 (23:38 +0200)
They might be created as result of merged answer sets, hence accept
them.

http://lists.freedesktop.org/archives/systemd-devel/2015-April/030834.html

src/resolve/resolved-dns-answer.c

index 7c4ab18..e08eb66 100644 (file)
@@ -25,8 +25,6 @@
 DnsAnswer *dns_answer_new(unsigned n) {
         DnsAnswer *a;
 
-        assert(n > 0);
-
         a = malloc0(offsetof(DnsAnswer, rrs) + sizeof(DnsResourceRecord*) * n);
         if (!a)
                 return NULL;