]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: hotplug: Don't access srcPriv when it's not allocated
authorPeter Krempa <pkrempa@redhat.com>
Tue, 3 Jul 2018 08:45:34 +0000 (10:45 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Jul 2018 14:42:14 +0000 (16:42 +0200)
commit33a475056fdd76c030528982e422bae79c0a0e4a
tree98c0156f02c23128cd5e4db62c2447e0f6fb9099
parent8677a476c7e5cbf7b344329d54d0b1a2d666ffc3
qemu: hotplug: Don't access srcPriv when it's not allocated

The private data of a virStorageSource which is backing an iSCSI hostdev
may be NULL if no authentication is present. The code handling the
hotplug would attempt to extract the authentication info stored in
'secinfo' without checking if it is allocated which resulted in a crash.

Here we opt the easy way to check if srcPriv is not NULL so that we
don't duplicate all the logic which selects whether the disk source has
a secret.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1597550

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_hotplug.c