mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 18:52:07 -04:00
Only call memmove if the rdata length is non zero
This avoids undefined behaviour on zero length rdata where the data pointer is NULL.
This commit is contained in:
parent
377bd35574
commit
228cc557fe
1 changed files with 3 additions and 1 deletions
|
|
@ -361,7 +361,9 @@ dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
|
|||
? DNS_RDATASLAB_OFFLINE
|
||||
: 0;
|
||||
}
|
||||
memmove(rawbuf, x[i].rdata.data, x[i].rdata.length);
|
||||
if (x[i].rdata.length != 0) {
|
||||
memmove(rawbuf, x[i].rdata.data, x[i].rdata.length);
|
||||
}
|
||||
rawbuf += x[i].rdata.length;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue