]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
conf: fix buffer initalization
authorYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 15 Jun 2010 21:11:55 +0000 (14:11 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 16 Jun 2010 17:14:20 +0000 (10:14 -0700)
This fixes a bug where we didn't initialize the variable
post processing buffer, which would sometimes lead to
garbage data.

src/config.cc

index 9615186145d054e4f5bcbb82c5abe9e02cdbb79d..085b100e512030897b8ac21492643d6350c93918 100644 (file)
@@ -795,6 +795,7 @@ char *conf_post_process_val(const char *val)
   size_t max_line = MAX_LINE;
 
   buf = (char *)malloc(max_line);
+  *buf = 0;
 
   while (val[i]) {
     if (val[i] == '$') {