From: Wouter Wijngaards Date: Thu, 1 Feb 2018 15:55:48 +0000 (+0000) Subject: - fix unaligned structure making a false positive in checklock X-Git-Tag: release-1.7.0rc1~71 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86057970024da934d06e81794ef5b6ddc5659835;p=thirdparty%2Funbound.git - fix unaligned structure making a false positive in checklock unitialised memory. git-svn-id: file:///svn/unbound/trunk@4490 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 7fc9f26a4..3af4ff2fd 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +1 February 2018: Wouter + - fix unaligned structure making a false positive in checklock + unitialised memory. + 29 January 2018: Ralph - Use NSEC with longest ce to prove wildcard absence. - Only use *.ce to prove wildcard absence, no longer names. diff --git a/util/data/msgreply.c b/util/data/msgreply.c index 153617692..dab64d657 100644 --- a/util/data/msgreply.c +++ b/util/data/msgreply.c @@ -632,8 +632,9 @@ query_info_entrysetup(struct query_info* q, struct reply_info* r, e->entry.data = r; lock_rw_init(&e->entry.lock); lock_protect(&e->entry.lock, &e->key, sizeof(e->key)); - lock_protect(&e->entry.lock, &e->entry.hash, sizeof(e->entry.hash) + - sizeof(e->entry.key) + sizeof(e->entry.data)); + lock_protect(&e->entry.lock, &e->entry.hash, sizeof(e->entry.hash)); + lock_protect(&e->entry.lock, &e->entry.key, sizeof(e->entry.key)); + lock_protect(&e->entry.lock, &e->entry.data, sizeof(e->entry.data)); lock_protect(&e->entry.lock, e->key.qname, e->key.qname_len); q->qname = NULL; return e;