Skip to content

Commit

Permalink
examples/fips_validation: handle empty payload
Browse files Browse the repository at this point in the history
[ upstream commit 0fab1428332bdfb213b51e068625d38419488646 ]

Allocate at least onebyte to handle empty payload in a test vector
when defined.

Fixes: 3d0fad5 ("examples/fips_validation: add crypto FIPS application")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  • Loading branch information
gmuthukrishn authored and cpaelzer committed Jul 7, 2022
1 parent 9ea7a5a commit b5d8c94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/fips_validation/fips_validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ parse_uint8_hex_str(const char *key, char *src, struct fips_val *val)
val->val = NULL;
}

val->val = rte_zmalloc(NULL, len, 0);
val->val = rte_zmalloc(NULL, len + 1, 0);
if (!val->val)
return -ENOMEM;

Expand Down

0 comments on commit b5d8c94

Please sign in to comment.