]> xenbits.xensource.com Git - libvirt.git/commit
qemu: monitor: Don't bother extracting vCPU halted state in text monitor
authorPeter Krempa <pkrempa@redhat.com>
Thu, 18 May 2017 11:27:24 +0000 (13:27 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 19 May 2017 07:31:19 +0000 (09:31 +0200)
commit6ff99e95771bb33531ea6733a823bc6a30158256
tree839f30ec6ec7103afcaa71690316050b64e98bc2
parent6a12907d86a958daf0a9db58a038bf7201eb1a65
qemu: monitor: Don't bother extracting vCPU halted state in text monitor

The code causes the 'offset' variable to be overwritten (possibly with
NULL if neither of the vCPUs is halted) which causes a crash since the
variable is still used after that part.

Additionally there's a bug, since strstr() would look up the '(halted)'
string in the whole string rather than just the currently processed line
the returned data is completely bogus.

Rather than switching to single line parsing let's remove the code
altogether since it has a commonly used JSON monitor alternative and
the data itself is not very useful to report.

The code was introduced in commit cc5e695bde

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1452106
src/qemu/qemu_monitor_text.c