[systemd-commits] src/resolve
Lennart Poettering
lennart at kemper.freedesktop.org
Wed Jul 30 05:23:24 PDT 2014
src/resolve/resolved-dns-cache.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 0ec7c46eed06269edf80121ec53f1eba2e2870d4
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Jul 30 14:21:18 2014 +0200
resolved: properly handle adding empty replies to cache
diff --git a/src/resolve/resolved-dns-cache.c b/src/resolve/resolved-dns-cache.c
index 28a375b..7359dfa 100644
--- a/src/resolve/resolved-dns-cache.c
+++ b/src/resolve/resolved-dns-cache.c
@@ -352,12 +352,16 @@ int dns_cache_put(DnsCache *c, DnsQuestion *q, int rcode, DnsAnswer *answer, uns
int r;
assert(c);
- assert(answer);
+ assert(q);
/* First, delete all matching old RRs, so that we only keep
* complete by_key in place. */
for (i = 0; i < q->n_keys; i++)
dns_cache_remove(c, q->keys[i]);
+
+ if (!answer)
+ return 0;
+
for (i = 0; i < answer->n_rrs; i++)
dns_cache_remove(c, answer->rrs[i]->key);
More information about the systemd-commits
mailing list