mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
storage: Fix a NULL ptr dereference in virStorageBackendCreateQemuImg
There was a missing check for vol->target.encryption being NULL at one particular place (modified by commit a48c71411) which caused a crash when user attempted to create a raw volume using a non-raw file volume as source. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1363636 Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
5b7dedc995
commit
5a3558c620
@ -1459,6 +1459,7 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (vol->target.format == VIR_STORAGE_FILE_RAW &&
|
if (vol->target.format == VIR_STORAGE_FILE_RAW &&
|
||||||
|
vol->target.encryption &&
|
||||||
vol->target.encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
|
vol->target.encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
|
||||||
if (!(secretPath =
|
if (!(secretPath =
|
||||||
virStorageBackendCreateQemuImgSecretPath(conn, pool, vol)))
|
virStorageBackendCreateQemuImgSecretPath(conn, pool, vol)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user