From: Marek Schimara Date: Thu, 16 Jun 2016 14:09:00 +0000 (+0200) Subject: src/rrd_xport.c: fix Coverity CID#23524 Uninitialized scalar variable X-Git-Tag: v1.7.0~42^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=45459c744b5d2d8095e217fe12f45eb142ece7c3;p=thirdparty%2Frrdtool-1.x.git src/rrd_xport.c: fix Coverity CID#23524 Uninitialized scalar variable CWE-457 / https://cwe.mitre.org/data/definitions/457.html --- diff --git a/src/rrd_xport.c b/src/rrd_xport.c index b47b2586..388f7854 100644 --- a/src/rrd_xport.c +++ b/src/rrd_xport.c @@ -863,6 +863,9 @@ int rrd_xport_format_addprints(int flags,stringbuffer_t *buffer,image_desc_t *im char* timefmt=NULL; if (im->xlab_user.minsec!=-1.0) { timefmt=im->xlab_user.stst; } + /* avoid calling escapeJSON() with garbage */ + memset(dbuf, 0, sizeof(dbuf)); + /* define some other stuff based on flags */ int json=0; if (flags &1) { json=1; }