examples/fips_validation: fix buffer overflow
authorOlivier Matz <olivier.matz@6wind.com>
Tue, 6 Oct 2020 07:41:41 +0000 (09:41 +0200)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 14 Oct 2020 20:22:06 +0000 (22:22 +0200)
commit9275af3bd9faa0337b418736bb622704d158fbac
tree58523740d08e91b7bed05d78f5c2f1c61e5f0ecc
parent784fb396f72d98070f3afaf309a7addb4c0d8da1
examples/fips_validation: fix buffer overflow

If the file name is larger than MAX_STRING_SIZE (64), strcpy()
will overwrite the content of memory.

Replace strcpy() by rte_strscpy(), check its return value, and
increase file_name size to 256.

Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS application")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
examples/fips_validation/fips_validation.c
examples/fips_validation/fips_validation.h