mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
tldap: Make memcpy of no controls safe
Static analyzers sometimes complain about this case. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14029
This commit is contained in:
parent
1a7f2a230d
commit
e5452a3742
@ -588,7 +588,9 @@ struct tldap_control *tldap_add_control(TALLOC_CTX *mem_ctx,
|
||||
if (result == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
memcpy(result, ctrls, sizeof(struct tldap_control) * num_ctrls);
|
||||
if (num_ctrls > 0) {
|
||||
memcpy(result, ctrls, sizeof(struct tldap_control) * num_ctrls);
|
||||
}
|
||||
result[num_ctrls] = *ctrl;
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user