]> xenbits.xensource.com Git - libvirt.git/commit
qemu: avoid null deref on block pull error
authorEric Blake <eblake@redhat.com>
Tue, 2 Aug 2011 19:17:04 +0000 (13:17 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 2 Aug 2011 21:04:36 +0000 (15:04 -0600)
commit9160573d327465e5f7ecbb6b2e37fd0eba3fb43b
tree173f991b4e312b8f043de43f988afec69b5b17ff
parent94b5dae479c51e8cc457885b2fe92c0c104c4142
qemu: avoid null deref on block pull error

Coverity detected that 5 of 6 callers of virJSONValueArrayGet checked
for a NULL return; and that by not checking we risk a null deref
during an error.  The error is unlikely since the prior call to
virJSONValueArraySize would probably have already caught any botched
JSON array parse, but better safe than sorry.

* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBlockJobInfo):
Check for NULL.
(qemuMonitorJSONExtractPtyPaths): Fix typo.
src/qemu/qemu_monitor_json.c