mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 01:43:23 +00:00
qemuMonitorTextGetAllBlockStatsInfo: Fix line validation
There's a bug in the function. We expect the following format for the data we are parsing here: key: value So we use strchr() to find ':' and then see if it is followed by space. But the check that does just that is slightly incorrect. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
2bd61c8448
commit
c94720f86a
@ -892,7 +892,7 @@ qemuMonitorTextGetAllBlockStatsInfo(qemuMonitorPtr mon,
|
|||||||
/* extract device name and make sure that it's followed by
|
/* extract device name and make sure that it's followed by
|
||||||
* a colon and space */
|
* a colon and space */
|
||||||
dev_name = line;
|
dev_name = line;
|
||||||
if (!(line = strchr(line, ':')) && line[1] != ' ') {
|
if (!(line = strchr(line, ':')) || line[1] != ' ') {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("info blockstats reply was malformed"));
|
_("info blockstats reply was malformed"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user