mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: block: Break out early on invalid storage sources
Return NULL right away in qemuBlockStorageSourceGetBackendProps when an invalid storage source is presented so that virJSONValueObjectAdd isn't called with a NULL argument. Found by coverity.
This commit is contained in:
parent
19448a2561
commit
bb15ac4599
@ -958,7 +958,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src)
|
|||||||
case VIR_STORAGE_TYPE_VOLUME:
|
case VIR_STORAGE_TYPE_VOLUME:
|
||||||
case VIR_STORAGE_TYPE_NONE:
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
case VIR_STORAGE_TYPE_LAST:
|
case VIR_STORAGE_TYPE_LAST:
|
||||||
break;
|
return NULL;
|
||||||
|
|
||||||
case VIR_STORAGE_TYPE_NETWORK:
|
case VIR_STORAGE_TYPE_NETWORK:
|
||||||
switch ((virStorageNetProtocol) src->protocol) {
|
switch ((virStorageNetProtocol) src->protocol) {
|
||||||
@ -1008,7 +1008,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src)
|
|||||||
|
|
||||||
case VIR_STORAGE_NET_PROTOCOL_NONE:
|
case VIR_STORAGE_NET_PROTOCOL_NONE:
|
||||||
case VIR_STORAGE_NET_PROTOCOL_LAST:
|
case VIR_STORAGE_NET_PROTOCOL_LAST:
|
||||||
break;
|
return NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user