We need to check obj ptr before passing it to
virJSONValueObjectHasKey(). If it's NULL it will fail with SIGSEGV.

Signed-off-by: Nikolai Barybin <nikolai.bary...@virtuozzo.com>
---
 src/qemu/qemu_qapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_qapi.c b/src/qemu/qemu_qapi.c
index 184c0a965f..a2fef55019 100644
--- a/src/qemu/qemu_qapi.c
+++ b/src/qemu/qemu_qapi.c
@@ -180,7 +180,7 @@ virQEMUQAPISchemaTraverseObject(virJSONValue *cur,
     } else {
         obj = virQEMUQAPISchemaObjectGet("members", query, "name", cur);
 
-        if (modifier == '*' &&
+        if (modifier == '*' && obj &&
             !virJSONValueObjectHasKey(obj, "default"))
             return 0;
     }
-- 
2.43.5

Reply via email to