fips_test_clear();
- strcpy(info.file_name, req_file_path);
+ if (rte_strscpy(info.file_name, req_file_path,
+ sizeof(info.file_name)) < 0) {
+ RTE_LOG(ERR, USER1, "Path %s too long\n", req_file_path);
+ return -EINVAL;
+ }
info.algo = FIPS_TEST_ALGO_MAX;
if (parse_file_type(req_file_path) < 0) {
RTE_LOG(ERR, USER1, "File %s type not supported\n",
return -ENOMEM;
}
- strlcpy(info.device_name, device_name, sizeof(info.device_name));
+ if (rte_strscpy(info.device_name, device_name,
+ sizeof(info.device_name)) < 0) {
+ RTE_LOG(ERR, USER1, "Device name %s too long\n", device_name);
+ return -EINVAL;
+ }
if (fips_test_parse_header() < 0) {
RTE_LOG(ERR, USER1, "Failed parsing header\n");
#define MAX_NB_TESTS 10240
#define MAX_BUF_SIZE 2048
#define MAX_STRING_SIZE 64
+#define MAX_FILE_NAME_SIZE 256
#define MAX_DIGEST_SIZE 64
#define POSITIVE_TEST 0
uint32_t vec_start_off;
uint32_t nb_vec_lines;
char device_name[MAX_STRING_SIZE];
- char file_name[MAX_STRING_SIZE];
+ char file_name[MAX_FILE_NAME_SIZE];
union {
struct aesavs_interim_data aes_data;