mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virSecurityLabelDefParseXML: Don't use virXMLPropStringLimit
The function produces an error which is ignored in this code path. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f3a8f26339
commit
01ab6513bd
@ -7804,8 +7804,9 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt,
|
|||||||
g_autofree char *relabel = NULL;
|
g_autofree char *relabel = NULL;
|
||||||
g_autoptr(virSecurityLabelDef) seclabel = NULL;
|
g_autoptr(virSecurityLabelDef) seclabel = NULL;
|
||||||
|
|
||||||
model = virXMLPropStringLimit(ctxt->node, "model",
|
if ((model = virXMLPropString(ctxt->node, "model")) &&
|
||||||
VIR_SECURITY_MODEL_BUFLEN - 1);
|
strlen(model) >= VIR_SECURITY_MODEL_BUFLEN - 1)
|
||||||
|
g_clear_pointer(&model, g_free);
|
||||||
|
|
||||||
if (!(seclabel = virSecurityLabelDefNew(model)))
|
if (!(seclabel = virSecurityLabelDefNew(model)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user