app/crypto-perf: use strcpy for allocated string
authorJerin Jacob <jerin.jacob@caviumnetworks.com>
Wed, 16 May 2018 12:28:03 +0000 (17:58 +0530)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Tue, 22 May 2018 14:36:11 +0000 (16:36 +0200)
commit21f579fcefd3ac21d1894be662f774cf48bb914e
treea2dafc3a0ebf60b01c7cdbeb26d7c357a94cd840
parent91b9c522d61c752708db7005452ebb4b05baff7a
app/crypto-perf: use strcpy for allocated string

inlined from ‘cperf_test_vector_get_from_file’ at
app/test-crypto-perf/cperf_test_vector_parsing.c:578:11:
app/test-crypto-perf/cperf_test_vector_parsing.c:510:3: error:
‘strncpy’ output truncated before terminating nul copying as many bytes
from a string as its length [-Werror=stringop-truncation]
   strncpy(entry, line, strlen(line));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/test-crypto-perf/cperf_test_vector_parsing.c:528:5: error:
‘strncat’ output truncated before terminating nul copying as many bytes
from a string as its length [-Werror=stringop-truncation]
     strncat(entry, line, strlen(line));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found this issue with meson build and gcc 8.1.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
app/test-crypto-perf/cperf_test_vector_parsing.c