[PATCH] test_driver: avoid using nerrors unitialized in testDomainGetDiskErrors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Right now nerrors can be used unitialized in the last for loop causing
a bug.

Signed-off-by: Ilias Stamatis <stamatis.iliass@xxxxxxxxx>
---
 src/test/test_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index ce4ff1a582..2371581f51 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -3275,7 +3275,7 @@ static int testDomainGetDiskErrors(virDomainPtr dom,
     virDomainObjPtr vm = NULL;
     int ret = -1;
     size_t i;
-    size_t nerrors;
+    size_t nerrors = 0;

     virCheckFlags(0, -1);

--
2.22.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux