summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec2e074)
raw | patch | inline | side by side (parent: ec2e074)
author | Vincent Bernat <vincent@bernat.im> | |
Mon, 3 Aug 2015 08:06:30 +0000 (10:06 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 3 Aug 2015 21:23:24 +0000 (23:23 +0200) |
With YAJL 1 (at least on Ubuntu Precise), if `conf.indentString` is not
initialized correctly, we would get a segfault even when `conf.beautify`
is set to 0. We avoid this case by initializing the whole structure to
0. `conf.beautify = 0` is kept for explicitness.
initialized correctly, we would get a segfault even when `conf.beautify`
is set to 0. We avoid this case by initializing the whole structure to
0. `conf.beautify = 0` is kept for explicitness.
src/log_logstash.c | patch | blob | history |
diff --git a/src/log_logstash.c b/src/log_logstash.c
index 61e7f4848e3a4b6dd24f87cf5ac3fb630416e7fd..2883e6c97d2872ac8e4e396cdedbe849e4effce5 100644 (file)
--- a/src/log_logstash.c
+++ b/src/log_logstash.c
{
yajl_gen g;
#if !defined(HAVE_YAJL_V2)
- yajl_gen_config conf;
+ yajl_gen_config conf = {};
conf.beautify = 0;
#endif
#if HAVE_YAJL_V2
g = yajl_gen_alloc(NULL);
#else
- yajl_gen_config conf;
+ yajl_gen_config conf = {};
conf.beautify = 0;
g = yajl_gen_alloc(&conf, NULL);