From: Marek Schimara Date: Fri, 17 Jun 2016 07:52:55 +0000 (+0200) Subject: src/rrd_daemon.c: fix Coverity CID#13672 Pointer to local outside scope X-Git-Tag: v1.7.0~42^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d08f4748eb3057e77ca288b1c2f52ec46c17b3f2;p=thirdparty%2Frrdtool-1.x.git src/rrd_daemon.c: fix Coverity CID#13672 Pointer to local outside scope CWE-562 / https://cwe.mitre.org/data/definitions/562.html --- diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 65b7c2c0..55247c38 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -2699,6 +2699,7 @@ static int handle_request_help (HANDLER_PROTO) /* {{{ */ int status; char *cmd_str; char *resp_txt; + char tmp[RRD_CMD_MAX]; command_t *help = NULL; status = buffer_get_field (&buffer, &buffer_size, &cmd_str); @@ -2707,8 +2708,6 @@ static int handle_request_help (HANDLER_PROTO) /* {{{ */ if (help && (help->syntax || help->help)) { - char tmp[RRD_CMD_MAX]; - snprintf(tmp, sizeof(tmp)-1, "Help for %s\n", help->cmd); resp_txt = tmp;