From: John Ferlan Date: Thu, 11 Jul 2013 14:28:44 +0000 (-0400) Subject: virsh-domain-monitor: Resolve Coverity issues X-Git-Tag: CVE-2013-4154~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cfd40ac0caf9dbde00de8d75750357ffc6331de;p=thirdparty%2Flibvirt.git virsh-domain-monitor: Resolve Coverity issues Recent changes uncovered a pair of NEGATIVE_RETURNS when processing the 'nnames' in 'vshDomainListCollect' in the for loop due to possible -1 value. --- diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 7af765e8ec..5fbd32c164 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -1599,7 +1599,7 @@ finished: success = true; cleanup: - for (i = 0; i < nnames; i++) + for (i = 0; nnames != -1 && i < nnames; i++) VIR_FREE(names[i]); if (!success) {