mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
lib:addns: Don’t call memcpy() with a NULL pointer
Doing so is undefined behaviour. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
f60249eed5
commit
2eb458118c
@ -88,7 +88,9 @@ void dns_marshall_buffer(struct dns_buffer *buf, const uint8_t *data,
|
|||||||
buf->data = new_data;
|
buf->data = new_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(buf->data + buf->offset, data, len);
|
if (data != NULL) {
|
||||||
|
memcpy(buf->data + buf->offset, data, len);
|
||||||
|
}
|
||||||
buf->offset += len;
|
buf->offset += len;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user