mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-14 14:42:22 -04:00
4869. [bug] Address some cases where NULL with zero length could
be passed to memmove which is undefined behaviour and
can lead to bad optimisation. [RT #46888]
(cherry picked from commit fdd8838bf9)
This commit is contained in:
parent
a7a018063c
commit
bce96b1f70
2 changed files with 12 additions and 3 deletions
4
CHANGES
4
CHANGES
|
|
@ -1,3 +1,7 @@
|
|||
4869. [bug] Address some cases where NULL with zero length could
|
||||
be passed to memmove which is undefined behaviour and
|
||||
can lead to bad optimisation. [RT #46888]
|
||||
|
||||
4867. [cleanup] Normalize rndc on/off commands (validation and
|
||||
querylog) so they accept the same synonyms
|
||||
for on/off (yes/no, true/false, enable/disable).
|
||||
|
|
|
|||
|
|
@ -89,11 +89,16 @@ dns_difftuple_create(isc_mem_t *mctx,
|
|||
|
||||
t->ttl = ttl;
|
||||
|
||||
memmove(datap, rdata->data, rdata->length);
|
||||
dns_rdata_init(&t->rdata);
|
||||
dns_rdata_clone(rdata, &t->rdata);
|
||||
t->rdata.data = datap;
|
||||
datap += rdata->length;
|
||||
if (rdata->data != NULL) {
|
||||
memmove(datap, rdata->data, rdata->length);
|
||||
t->rdata.data = datap;
|
||||
datap += rdata->length;
|
||||
} else {
|
||||
t->rdata.data = NULL;
|
||||
INSIST(rdata->length == 0);
|
||||
}
|
||||
|
||||
ISC_LINK_INIT(&t->rdata, link);
|
||||
ISC_LINK_INIT(t, link);
|
||||
|
|
|
|||
Loading…
Reference in a new issue