teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Blob Blame History Raw
From d5b06145261637bcb69c1a213874cce10918a189 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 18 May 2015 23:38:47 +0200
Subject: [PATCH] resolved: allow DnsAnswer objects with no space for RRs

They might be created as result of merged answer sets, hence accept
them.

http://lists.freedesktop.org/archives/systemd-devel/2015-April/030834.html
(cherry picked from commit 084cea6cee1471d81e078bea4e7ee5f50a5dc009)

Cherry-picked from: 084cea6
Resolves: #1222517
---
 src/resolve/resolved-dns-answer.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/resolve/resolved-dns-answer.c b/src/resolve/resolved-dns-answer.c
index 7c4ab18b58..e08eb667cc 100644
--- a/src/resolve/resolved-dns-answer.c
+++ b/src/resolve/resolved-dns-answer.c
@@ -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;