[v2] example/fips_validation: handle empty payload

Message ID c15acd17b2d2cee063af81f001aaf6f25475efe3.1656421405.git.gmuthukrishn@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v2] example/fips_validation: handle empty payload |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Gowrishankar Muthukrishnan June 28, 2022, 1:11 p.m. UTC
  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>
---
v2:
 - commit message corrections.
---
 examples/fips_validation/fips_validation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Fan Zhang June 29, 2022, 8:07 a.m. UTC | #1
> -----Original Message-----
> From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Sent: Tuesday, June 28, 2022 2:11 PM
> To: dev@dpdk.org
> Cc: Zhang, Roy Fan <roy.fan.zhang@intel.com>; Dooley, Brian
> <brian.dooley@intel.com>; Anoob Joseph <anoobj@marvell.com>; Archana
> Muniganti <marchana@marvell.com>; Jerin Jacob <jerinj@marvell.com>;
> Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>; stable@dpdk.org
> Subject: [PATCH v2] example/fips_validation: handle empty payload
> 
> 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>
> ---
> v2:
>  - commit message corrections.

Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  
Akhil Goyal June 30, 2022, 4:24 a.m. UTC | #2
> > Subject: [PATCH v2] example/fips_validation: handle empty payload
> >
> > 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>
> > ---
> > v2:
> >  - commit message corrections.
> 
> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Applied to dpdk-next-crypto

Thanks.
  

Patch

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;