]> git.ipfire.org Git - thirdparty/qemu.git/commit
json-parser: Fix potential NULL pointer segfault
authorStefan Weil <sw@weilnetz.de>
Mon, 3 Sep 2012 19:19:11 +0000 (21:19 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 9 Oct 2012 06:58:29 +0000 (01:58 -0500)
commit3aec24d19512bff2ffb0bf3bb97b8a48e47a8825
treed03bebe48c83a85b000ac60370759066c18691e8
parent122b92d90af40cff485e5e9ba2a64842d1f7ff48
json-parser: Fix potential NULL pointer segfault

Report from smatch:
json-parser.c:474 parse_object(62) error: potential null derefence 'dict'.
json-parser.c:553 parse_array(75) error: potential null derefence 'list'.

Label 'out' in json-parser.c can be called with list == NULL
which is passed to QDECREF.

Modify QDECREF to handle a NULL argument (inline function qobject_decref
already handles them, too).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
(cherry picked from commit 149474c93490e1c66f838391bd491db83136d91d)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qobject.h