[PATCH 11/12] virSecurityLabelDefParseXML: Don't use virXMLPropStringLimit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The function produces an error which is ignored in this code path.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d6eefed398..17ba810467 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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;
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux