Blob Blame Raw
From 8a896123e4162dfca23834023f2bb50ffa618f55 Mon Sep 17 00:00:00 2001
Message-Id: <8a896123e4162dfca23834023f2bb50ffa618f55@dist-git>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 6 Nov 2014 10:20:40 +0100
Subject: [PATCH] Check return value of libvirt_uintUnwrap

libvirt_virDomainSendKey didn't check whether libvirt_uintUnwrap
succeeded or not.

https://bugzilla.redhat.com/show_bug.cgi?id=1161039
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 8dcdc7f2b4d8ebe7c892a2f92c23f77c59106189)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 libvirt-override.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libvirt-override.c b/libvirt-override.c
index f528100..1a91c7f 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -7149,7 +7149,8 @@ libvirt_virDomainSendKey(PyObject *self ATTRIBUTE_UNUSED,
     }
 
     for (i = 0; i < nkeycodes; i++) {
-        libvirt_uintUnwrap(PyList_GetItem(pyobj_list, i), &(keycodes[i]));
+        if (libvirt_uintUnwrap(PyList_GetItem(pyobj_list, i), &keycodes[i]) < 0)
+            return NULL;
     }
 
     LIBVIRT_BEGIN_ALLOW_THREADS;
-- 
2.1.3