From 634516262aa1fca541fca0e2d06404559de14a43 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Thu, 18 Feb 2021 14:51:12 +0100 Subject: [PATCH] hyperv: check return value of virUUIDGenerate MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes: fa66bd8cad2359b7d21676e0fd69bec472b36514 Signed-off-by: Ján Tomko Reviewed-by: Erik Skultety --- src/hyperv/hyperv_driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index c1ed4b5c7c..701456cdb3 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -1080,7 +1080,9 @@ hypervDomainAttachSyntheticEthernetAdapter(virDomainPtr domain, */ portResourceType = g_strdup_printf("%d", MSVM_RASD_RESOURCETYPE_ETHERNET_ADAPTER); - virUUIDGenerate(vsiGuid); + if (virUUIDGenerate(vsiGuid) < 0) + return -1; + virUUIDFormat(vsiGuid, guidString); virtualSystemIdentifiers = g_strdup_printf("{%s}", guidString); -- 2.47.2