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:
Peter Krempa 2021-11-22 17:43:13 +01:00
parent f3a8f26339
commit 01ab6513bd

View File

@ -7804,8 +7804,9 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt,
g_autofree char *relabel = NULL;
g_autoptr(virSecurityLabelDef) seclabel = NULL;
model = virXMLPropStringLimit(ctxt->node, "model",
VIR_SECURITY_MODEL_BUFLEN - 1);
if ((model = virXMLPropString(ctxt->node, "model")) &&
strlen(model) >= VIR_SECURITY_MODEL_BUFLEN - 1)
g_clear_pointer(&model, g_free);
if (!(seclabel = virSecurityLabelDefNew(model)))
return NULL;