提交 9d418b20 编写于 作者: J John Ferlan

conf: Fix error path in virNodeDevPCICapabilityParseXML

If the call to virXPathNodeSet to set naddresses fails, Coverity notes
that the subsequent VIR_ALLOC_N cannot have a negative value (well it
probably wouldn't be negative per se).
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 70e9114e
......@@ -1305,7 +1305,10 @@ virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ctxt,
data->pci_dev.physical_function) < 0)
goto out;
} else if (STREQ(type, "virt_functions")) {
int naddresses = virXPathNodeSet("./address", ctxt, &addresses);
int naddresses;
if ((naddresses = virXPathNodeSet("./address", ctxt, &addresses)) < 0)
goto out;
if (maxFuncsStr &&
virStrToLong_uip(maxFuncsStr, NULL, 10,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册