Re: [libvirt] [PATCH 2/2] nss: Need to check error condition on virJSONValueArraySize

2016-12-08 Thread Michal Privoznik
On 07.12.2016 14:20, John Ferlan wrote: > 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

[libvirt] [PATCH 2/2] nss: Need to check error condition on virJSONValueArraySize

2016-12-07 Thread John Ferlan
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 Signed-off-by: John