[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] qemu: add return value check

On 09/16/2011 09:51 AM, ajia redhat com wrote:
From: Alex Jia<ajia redhat com>

* src/qemu/qemu_command.c: missing return value check.

Signed-off-by: Alex Jia<ajia redhat com>
  src/qemu/qemu_command.c |    7 +++++--
  1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 5f0de40..e8b1157 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1702,7 +1702,8 @@ qemuBuildDriveDevStr(virDomainDiskDefPtr disk,
              virBufferAsprintf(&opt, ",event_idx=%s",
-        qemuBuildDeviceAddressStr(&opt,&disk->info, qemuCaps);
+        if (qemuBuildDeviceAddressStr(&opt,&disk->info, qemuCaps)<  0)
+            goto error;

ACK and pushed.  I'm assuming you found this with a static analyzer?

Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]