[libvirt] [PATCH] don't dereference uninitialized pointer

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

 



>From a907d2da7e7f9d1f58009ff6a95454ac0eb2cbf1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@xxxxxxxxxx>
Date: Mon, 2 Mar 2009 10:10:02 +0100
Subject: [PATCH] don't dereference uninitialized pointer

* src/storage_conf.c (virStoragePoolDefParsePerms): Initialize
"ptr" to NULL.
---
 ChangeLog          |    6 ++++++
 src/storage_conf.c |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 12715f5..ede7e0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-02  Jim Meyering  <meyering@xxxxxxxxxx>
+
+	don't dereference uninitialized pointer
+	* src/storage_conf.c (virStoragePoolDefParsePerms): Initialize
+	"ptr" to NULL.
+
 Fri Feb 27 17:15:00 CET 2009 Chris Lalancette <clalance@xxxxxxxxxx>

 	* src/qemu_driver.c: If there is a failure during offline migrate,
diff --git a/src/storage_conf.c b/src/storage_conf.c
index 70107a2..4a53ff4 100644
--- a/src/storage_conf.c
+++ b/src/storage_conf.c
@@ -381,7 +381,7 @@ virStoragePoolDefParsePerms(virConnectPtr conn,
     if (!mode) {
         perms->mode = 0700;
     } else {
-        char *end;
+        char *end = NULL;
         perms->mode = strtol(mode, &end, 8);
         if (*end || perms->mode < 0 || perms->mode > 0777) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
--
1.6.2.rc1.285.gc5f54

--
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]