mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
qemu: Validate arg in qemuAgentErrorComandUnsupported()
Coverity noted that 'reply' can be NULL after calling qemuAgentCommand(). Avoid dereferencing reply in qemuAgentErrorComandUnsupported() in that case. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
9a99b01f8d
commit
be9d259ebc
@ -1005,7 +1005,12 @@ static bool
|
||||
qemuAgentErrorCommandUnsupported(virJSONValuePtr reply)
|
||||
{
|
||||
const char *klass;
|
||||
virJSONValuePtr error = virJSONValueObjectGet(reply, "error");
|
||||
virJSONValuePtr error;
|
||||
|
||||
if (!reply)
|
||||
return false;
|
||||
|
||||
error = virJSONValueObjectGet(reply, "error");
|
||||
|
||||
if (!error)
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user