]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
avoid stack use after scope 319/head
authorAaron Lipinski <kris.lipinski@gmail.com>
Fri, 9 Aug 2019 20:52:53 +0000 (08:52 +1200)
committerAaron Lipinski <kris.lipinski@gmail.com>
Fri, 9 Aug 2019 20:57:14 +0000 (08:57 +1200)
ui/cmdpipe.c

index 3581086dc1e6e28735c9ee36d8908dbfc2653d32..2119516ea9287402b34137de53fa300593e5c916 100644 (file)
@@ -73,9 +73,9 @@ int send_synchronous_command(
     struct mtr_ctl *ctl,
     struct packet_command_pipe_t *cmdpipe,
     const char *cmd,
-    struct command_t *result)
+    struct command_t *result,
+    char *reply)
 {
-    char reply[PACKET_REPLY_BUFFER_SIZE];
     int command_length;
     int write_length;
     int read_length;
@@ -120,11 +120,12 @@ int check_feature(
 {
     char check_command[COMMAND_BUFFER_SIZE];
     struct command_t reply;
+    char reply_buf[PACKET_REPLY_BUFFER_SIZE];
 
     snprintf(check_command, COMMAND_BUFFER_SIZE,
              "1 check-support feature %s\n", feature);
 
-    if (send_synchronous_command(ctl, cmdpipe, check_command, &reply) ==
+    if (send_synchronous_command(ctl, cmdpipe, check_command, &reply, reply_buf) ==
         -1) {
         return -1;
     }