diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-11-06 18:08:38 +0100 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-11-06 22:58:20 +0100 |
commit | eaa269484b3ea3f721d825b6003cc625787007b3 (patch) | |
tree | b2823a160ba6213668dbfe3361c5cf15dce7316b /src/resolve/resolved-dns-cache.c | |
parent | Merge pull request #17534 from poettering/resolved-more-tweaks (diff) | |
download | systemd-eaa269484b3ea3f721d825b6003cc625787007b3.tar.xz systemd-eaa269484b3ea3f721d825b6003cc625787007b3.zip |
resolved: fix non-initialized memory access
Fix for bug introduced in 1ed314087fab3988f3221b1b736a7e711f174349.
Diffstat (limited to '')
-rw-r--r-- | src/resolve/resolved-dns-cache.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/resolve/resolved-dns-cache.c b/src/resolve/resolved-dns-cache.c index 2c24381171..ccc5914046 100644 --- a/src/resolve/resolved-dns-cache.c +++ b/src/resolve/resolved-dns-cache.c @@ -531,9 +531,6 @@ static int dns_cache_put_negative( .type = rcode == DNS_RCODE_SUCCESS ? DNS_CACHE_NODATA : rcode == DNS_RCODE_NXDOMAIN ? DNS_CACHE_NXDOMAIN : DNS_CACHE_RCODE, - .until = - i->type == DNS_CACHE_RCODE ? timestamp + CACHE_TTL_STRANGE_RCODE_USEC : - calculate_until(soa, nsec_ttl, timestamp, true), .authenticated = authenticated, .owner_family = owner_family, .owner_address = *owner_address, @@ -541,6 +538,10 @@ static int dns_cache_put_negative( .rcode = rcode, }; + i->until = + i->type == DNS_CACHE_RCODE ? timestamp + CACHE_TTL_STRANGE_RCODE_USEC : + calculate_until(soa, nsec_ttl, timestamp, true); + if (i->type == DNS_CACHE_NXDOMAIN) { /* NXDOMAIN entries should apply equally to all types, so we use ANY as * a pseudo type for this purpose here. */ |