]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: do not access uninitialized memory in cmdDomFSInfo
authorJán Tomko <jtomko@redhat.com>
Tue, 12 Feb 2019 06:51:19 +0000 (07:51 +0100)
committerJán Tomko <jtomko@redhat.com>
Tue, 12 Feb 2019 09:14:53 +0000 (10:14 +0100)
Initialize 'info' to prevent accessing random access memory.

Introduced by commit 3072ded released in 4.8.0.

https://bugzilla.redhat.com/show_bug.cgi?id=1676354

Signed-off-by: Ján Tomko <jtomko@redhat.com>
tools/virsh-domain.c

index 651766cd84f907c135971373584cd0bc74705217..d5026286c95078656ea0c7b5f3c22cbc23868526 100644 (file)
@@ -13938,7 +13938,7 @@ cmdDomFSInfo(vshControl *ctl, const vshCmd *cmd)
     virDomainPtr dom = NULL;
     int rc = -1;
     size_t i, j;
-    virDomainFSInfoPtr *info;
+    virDomainFSInfoPtr *info = NULL;
     vshTablePtr table = NULL;
     size_t ninfos = 0;