[pulseaudio-commits] src/pulsecore

Tanu Kaskinen tanuk at kemper.freedesktop.org
Sat Jun 30 01:00:23 PDT 2012


 src/pulsecore/conf-parser.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e9fd8298776cb6cc31173ecf040817aab2d1da39
Author: poljar (Damir Jelić) <poljarinho at gmail.com>
Date:   Fri Jun 29 23:19:52 2012 +0200

    conf-parser: Initialize the state to zero immediately.
    
    Set the state variable immediately to zero so if we fail to open the
    configuration file we don't check an uninitialized pointer and free an
    nonexistent proplist.

diff --git a/src/pulsecore/conf-parser.c b/src/pulsecore/conf-parser.c
index 10b020c..062fa8e 100644
--- a/src/pulsecore/conf-parser.c
+++ b/src/pulsecore/conf-parser.c
@@ -163,6 +163,8 @@ int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_p
     pa_assert(filename);
     pa_assert(t);
 
+    pa_zero(state);
+
     if (!f && !(f = pa_fopen_cloexec(filename, "r"))) {
         if (errno == ENOENT) {
             pa_log_debug("Failed to open configuration file '%s': %s", filename, pa_cstrerror(errno));
@@ -174,7 +176,6 @@ int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_p
         goto finish;
     }
 
-    pa_zero(state);
     state.filename = filename;
     state.item_table = t;
     state.userdata = userdata;



More information about the pulseaudio-commits mailing list