提交 c214f56a 编写于 作者: J John Ferlan

conf: Resolve Coverity NEGATIVE_RETURNS

Commit id '73eda710' added virDomainKeyWrapDefParseXML which uses
virXPathNodeSet, but does not handle a -1 return thus causing a possible
loop condition exit problem later when the return value is used.

Change the logic to return the value from virXPathNodeSet if <= 0
上级 db1140f1
......@@ -942,8 +942,8 @@ virDomainKeyWrapDefParseXML(virDomainDefPtr def, xmlXPathContextPtr ctxt)
xmlNodePtr *nodes = NULL;
int n;
if (!(n = virXPathNodeSet("./keywrap/cipher", ctxt, &nodes)))
return 0;
if ((n = virXPathNodeSet("./keywrap/cipher", ctxt, &nodes)) < 0)
return n;
if (VIR_ALLOC(def->keywrap) < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册