]> git.ipfire.org Git - thirdparty/libvirt.git/commit
domain_conf: fix NULL dereference on error in virDomainObjCopyPersistentDef
authorPavel Hrdina <phrdina@redhat.com>
Wed, 11 Mar 2020 12:25:59 +0000 (13:25 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 16 Nov 2020 16:13:42 +0000 (17:13 +0100)
commitb96174d9f2dcf0197bb6e58eea3fbbda17043478
tree005bcc2e9785e92645694698b33737ff67142eff
parentba6385c952503b23494cc27773fcd3acd7735e3e
domain_conf: fix NULL dereference on error in virDomainObjCopyPersistentDef

The issue was introduced together with the function itself by commit
<da1eba6bc8f58bfce34136710d1979a3a44adb17>.  Calling
`virDomainObjGetPersistentDef` may return NULL which is later passed
to `virDomainDefFormat` where the `def` attribute is marked as NONNULL
and later in `virDomainDefFormatInternalSetRootName` it is actually
defererenced without any other check.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/domain_conf.c