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

Fixes: 3d0fad56b74 ("examples/fips_validation: add crypto FIPS application")
Cc: sta...@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukri...@marvell.com>
---
 examples/fips_validation/fips_validation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/fips_validation/fips_validation.c 
b/examples/fips_validation/fips_validation.c
index 94e31abf83..324abccb14 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -630,7 +630,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;
 
-- 
2.25.1

Reply via email to