examples/fips_validation: handle empty payload
authorGowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Tue, 28 Jun 2022 13:11:09 +0000 (18:41 +0530)
committerAkhil Goyal <gakhil@marvell.com>
Thu, 30 Jun 2022 04:54:21 +0000 (06:54 +0200)
Allocate at least onebyte to handle empty payload in a test vector
when defined.

Fixes: 3d0fad56b74 ("examples/fips_validation: add crypto FIPS application")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
examples/fips_validation/fips_validation.c

index 94e31ab..324abcc 100644 (file)
@@ -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;