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:
Andrea Bolognani 2018-07-20 09:50:37 +02:00
parent 6c0d0210cb
commit 19136bbf10

View File

@ -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: