[PATCH] network_conf: Don't free uninitialized pointers while parsing DNS SRV

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

 



If the user specified invalid protocol type in a network's SRV record
the error path ended up in freeing uninitialized pointers causing a
daemon crash.

*network_conf.c: virNetworkDNSSrvDefParseXML(): initialize local
                                                variables
---
 src/conf/network_conf.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 60cd888..515bc36 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -574,10 +574,10 @@ virNetworkDNSSrvDefParseXML(virNetworkDNSDefPtr def,
                             xmlNodePtr cur,
                             xmlXPathContextPtr ctxt)
 {
-    char *domain;
-    char *service;
-    char *protocol;
-    char *target;
+    char *domain = NULL;
+    char *service = NULL;
+    char *protocol = NULL;
+    char *target = NULL;
     int port;
     int priority;
     int weight;
-- 
1.7.8.6

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