From 45459c744b5d2d8095e217fe12f45eb142ece7c3 Mon Sep 17 00:00:00 2001 From: Marek Schimara Date: Thu, 16 Jun 2016 16:09:00 +0200 Subject: [PATCH] src/rrd_xport.c: fix Coverity CID#23524 Uninitialized scalar variable CWE-457 / https://cwe.mitre.org/data/definitions/457.html --- src/rrd_xport.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.47.3