mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 21:57:40 +03:00
esx: Use memcpy() in esxVI_CURL_Debug()
We're going to change virStrncpy() in a way that requires the source string to be NULL-terminated, so we'll no longer be able to use in this context. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
6c0d0210cb
commit
19136bbf10
@ -185,10 +185,8 @@ esxVI_CURL_Debug(CURL *curl ATTRIBUTE_UNUSED, curl_infotype type,
|
||||
if (VIR_ALLOC_N(buffer, size + 1) < 0)
|
||||
return 0;
|
||||
|
||||
if (virStrncpy(buffer, info, size, size + 1) < 0) {
|
||||
VIR_FREE(buffer);
|
||||
return 0;
|
||||
}
|
||||
memcpy(buffer, info, size);
|
||||
buffer[size] = '\0';
|
||||
|
||||
switch (type) {
|
||||
case CURLINFO_TEXT:
|
||||
|
Loading…
x
Reference in New Issue
Block a user