Blame SOURCES/libvirt-qemu-Properly-check-return-value-of-VIR_STRDUP-in-qemuDomainGetBlockIoTune.patch

3e5111
From f3e5eee71c29741d6d0230561fc1ceb26019629a Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <f3e5eee71c29741d6d0230561fc1ceb26019629a@dist-git>
3e5111
From: Peter Krempa <pkrempa@redhat.com>
3e5111
Date: Wed, 24 May 2017 12:48:06 +0200
3e5111
Subject: [PATCH] qemu: Properly check return value of VIR_STRDUP in
3e5111
 qemuDomainGetBlockIoTune
3e5111
3e5111
Setting the 'group_name' for a disk would falsely trigger a error path
3e5111
as in commit 4b57f76502 we did not properly check the return value of
3e5111
VIR_STRDUP.
3e5111
3e5111
(cherry picked from commit 3fe624b2689d825a47e86ae3fb9735313e9105c3)
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1433183
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/qemu/qemu_driver.c | 2 +-
3e5111
 1 file changed, 1 insertion(+), 1 deletion(-)
3e5111
3e5111
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
3e5111
index a0f641fd4..3241de4cb 100644
3e5111
--- a/src/qemu/qemu_driver.c
3e5111
+++ b/src/qemu/qemu_driver.c
3e5111
@@ -17750,7 +17750,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
3e5111
 
3e5111
         /* Group name needs to be copied since qemuMonitorGetBlockIoThrottle
3e5111
          * allocates it as well */
3e5111
-        if (VIR_STRDUP(reply.group_name, disk->blkdeviotune.group_name))
3e5111
+        if (VIR_STRDUP(reply.group_name, disk->blkdeviotune.group_name) < 0)
3e5111
             goto endjob;
3e5111
     }
3e5111
 
3e5111
-- 
3e5111
2.13.0
3e5111