1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

libcli: 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:
Joseph Sutton 2023-05-26 16:05:43 +12:00 committed by Andrew Bartlett
parent fb759809f8
commit 7f692601c5

View File

@ -513,7 +513,9 @@ NTSTATUS cldap_reply_send(struct cldap_socket *cldap, struct cldap_reply *io)
goto nomem;
}
memcpy(state->blob.data, blob1.data, blob1.length);
if (blob1.data != NULL) {
memcpy(state->blob.data, blob1.data, blob1.length);
}
memcpy(state->blob.data+blob1.length, blob2.data, blob2.length);
data_blob_free(&blob1);
data_blob_free(&blob2);