mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
util: Fix bug which will cause libvirtd crash
"virCommandRun": if "cmd->outbuf" or "cmd->errbuf" is NULL, libvirtd will be crashed when trying to start a qemu domain (which invokes "virCommandRun"), it caused by we try to use "*cmd->outbuf" and "*cmd->errbuf" regardless of cmd->outbuf or cmd->errbuf is NULL. * src/util/command.c (virCommandRun)
This commit is contained in:
parent
58d0f4d737
commit
85ccf42cd0
@ -931,8 +931,8 @@ virCommandRun(virCommandPtr cmd, int *exitstatus)
|
||||
ret = -1;
|
||||
|
||||
VIR_DEBUG("Result stdout: '%s' stderr: '%s'",
|
||||
NULLSTR(*cmd->outbuf),
|
||||
NULLSTR(*cmd->errbuf));
|
||||
cmd->outbuf ? NULLSTR(*cmd->outbuf) : "(null)",
|
||||
cmd->errbuf ? NULLSTR(*cmd->errbuf) : "(null)");
|
||||
|
||||
/* Reset any capturing, in case caller runs
|
||||
* this identical command again */
|
||||
|
Loading…
x
Reference in New Issue
Block a user