]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_daemon.c: fix Coverity CID#13672 Pointer to local outside scope
authorMarek Schimara <Marek.Schimara@bull.net>
Fri, 17 Jun 2016 07:52:55 +0000 (09:52 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Thu, 23 Jun 2016 14:32:33 +0000 (16:32 +0200)
        CWE-562 / https://cwe.mitre.org/data/definitions/562.html

src/rrd_daemon.c

index 65b7c2c091ade7cec54e78acd77a2c7634b455a4..55247c38075984cbdbd7adbd71e25913da1b68b2 100644 (file)
@@ -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;