virFileNBDDeviceAssociate: Avoid use of uninitialized variable CVE-2013-4297
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 3 Sep 2013 16:56:06 +0000 (18:56 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 4 Sep 2013 06:47:01 +0000 (08:47 +0200)
The @qemunbd variable can be used uninitialized.

src/util/virfile.c

index 2b07ac9..7af0843 100644 (file)
@@ -732,7 +732,7 @@ int virFileNBDDeviceAssociate(const char *file,
                               char **dev)
 {
     char *nbddev;
-    char *qemunbd;
+    char *qemunbd = NULL;
     virCommandPtr cmd = NULL;
     int ret = -1;
     const char *fmtstr = NULL;