app/testeventdev: fix string overflow in parsing
authorJerin Jacob <jerin.jacob@caviumnetworks.com>
Mon, 31 Jul 2017 10:04:51 +0000 (15:34 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 31 Jul 2017 20:43:39 +0000 (22:43 +0200)
Coverity issue: 158660
Fixes: 4afd440ec132 ("app/testeventdev: update options through command line")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
app/test-eventdev/evt_options.c

index dbab8ea..65e22f8 100644 (file)
@@ -109,7 +109,7 @@ evt_parse_queue_priority(struct evt_options *opt, const char *arg __rte_unused)
 static int
 evt_parse_test_name(struct evt_options *opt, const char *arg)
 {
-       strcpy(opt->test_name, arg);
+       snprintf(opt->test_name, EVT_TEST_NAME_MAX_LEN, "%s", arg);
        return 0;
 }