提交 270969c4 编写于 作者: M Matthias Bolte 提交者: Eric Blake

conf: Fix possible NULL dereference in virStorageVolTargetDefFormat

Commit dae1568c 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.
上级 9b1e4cd5
......@@ -1423,6 +1423,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
virBufferAsprintf(buf, "<format type='%s'/>\n", format);
}
if (def->perms) {
virBufferAddLit(buf, "<permissions>\n");
virBufferAdjustIndent(buf, 2);
......@@ -1439,6 +1440,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</permissions>\n");
}
if (def->timestamps) {
virBufferAddLit(buf, "<timestamps>\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册