From: Maksym Sobolyev Date: Mon, 27 Oct 2014 17:57:05 +0000 (-0700) Subject: Do a NULL check bit yearlier, before we actually try to deref the X-Git-Tag: v1.5.0-rc1~6^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22e753dd6985f0d8214fbc3d80ed106468ab00b5;p=thirdparty%2Frrdtool-1.x.git Do a NULL check bit yearlier, before we actually try to deref the pointer. Otherwise we might segfault in certain conditions. --- diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c index 69d379b4..03eaccf9 100644 --- a/src/rrd_graph_helper.c +++ b/src/rrd_graph_helper.c @@ -878,10 +878,10 @@ int parse_def(enum gf_en gf,parsedargs_t*pa,image_desc_t *const im){ |PARSE_END |PARSE_REDUCE ); + if (!gdp) { return 1;} if (gdp->step == 0){ gdp->step = im->step; /* initialize with image wide step */ } - if (!gdp) { return 1;} /* debugging output */ dprintf("=================================\n"); dprintf("DEF : %s\n",pa->arg_orig);