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

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



>From a907d2da7e7f9d1f58009ff6a95454ac0eb2cbf1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering redhat com>
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 redhat com>
+
+	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 redhat com>

 	* 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


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