mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: Fix possible NULL dereference in virStorageVolTargetDefFormat
Commit dae1568c6c converted the perms
member of the virStorageVolTarget struct into a pointer to make it
optional. But virStorageVolTargetDefFormat did not check perms for
NULL before dereferencing it.
This commit is contained in:
committed by
Eric Blake
parent
9b1e4cd503
commit
270969c4dd
@@ -1423,6 +1423,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
|
|||||||
virBufferAsprintf(buf, "<format type='%s'/>\n", format);
|
virBufferAsprintf(buf, "<format type='%s'/>\n", format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (def->perms) {
|
||||||
virBufferAddLit(buf, "<permissions>\n");
|
virBufferAddLit(buf, "<permissions>\n");
|
||||||
virBufferAdjustIndent(buf, 2);
|
virBufferAdjustIndent(buf, 2);
|
||||||
|
|
||||||
@@ -1439,6 +1440,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
|
|||||||
|
|
||||||
virBufferAdjustIndent(buf, -2);
|
virBufferAdjustIndent(buf, -2);
|
||||||
virBufferAddLit(buf, "</permissions>\n");
|
virBufferAddLit(buf, "</permissions>\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (def->timestamps) {
|
if (def->timestamps) {
|
||||||
virBufferAddLit(buf, "<timestamps>\n");
|
virBufferAddLit(buf, "<timestamps>\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user