提交 03876cf5 编写于 作者: J John Ferlan

nss: Need to check error condition on virJSONValueArraySize

If the 'nleases < 0' on return, then the subsequent call to
findLeaseInJSON will not produce the expected results (passed
in as a size_t, but nleases is a ssize_t).  So check if the
returned value < 0 and if so, goto cleanup.

Found by Coverity as a NEGATIVE_RETURNS event
上级 80acf4b8
......@@ -309,7 +309,8 @@ findLease(const char *name,
}
VIR_DIR_CLOSE(dir);
nleases = virJSONValueArraySize(leases_array);
if ((nleases = virJSONValueArraySize(leases_array)) < 0)
goto cleanup;
DEBUG("Read %zd leases", nleases);
#if !defined(LIBVIRT_NSS_GUEST)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册