examples/l2fwd-crypto: fix uninitialized errno value

Message ID 1503491044-27863-1-git-send-email-hemant.agrawal@nxp.com
State New
Headers show

Commit Message

Hemant Agrawal Aug. 23, 2017, 12:24 p.m.
errno should be initialized to 0 before calling strtol

Fixes: 1df9c0109f4c ("examples/l2fwd-crypto: parse key parameters")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 examples/l2fwd-crypto/main.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.7.4

Comments

De Lara Guarch, Pablo Sept. 4, 2017, 2:53 p.m. | #1
> -----Original Message-----

> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]

> Sent: Wednesday, August 23, 2017 1:24 PM

> To: dev@dpdk.org

> Cc: Doherty, Declan <declan.doherty@intel.com>; De Lara Guarch, Pablo

> <pablo.de.lara.guarch@intel.com>; akhil.goyal@nxp.com

> Subject: [PATCH] examples/l2fwd-crypto: fix uninitialized errno value

> 

> errno should be initialized to 0 before calling strtol

> 

> Fixes: 1df9c0109f4c ("examples/l2fwd-crypto: parse key parameters")

> Cc: stable@dpdk.org

> 

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>


Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Rybalchenko, Kirill Sept. 4, 2017, 2:53 p.m. | #2
> -----Original Message-----

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Hemant Agrawal

> Sent: Wednesday 23 August 2017 13:24

> To: dev@dpdk.org

> Cc: Doherty, Declan <declan.doherty@intel.com>; De Lara Guarch, Pablo

> <pablo.de.lara.guarch@intel.com>; akhil.goyal@nxp.com

> Subject: [dpdk-dev] [PATCH] examples/l2fwd-crypto: fix uninitialized errno

> value

> 

> errno should be initialized to 0 before calling strtol

> 

> Fixes: 1df9c0109f4c ("examples/l2fwd-crypto: parse key parameters")

> Cc: stable@dpdk.org

> 

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> ---

>  examples/l2fwd-crypto/main.c | 1 +

>  1 file changed, 1 insertion(+)

> 


Reviewed-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
De Lara Guarch, Pablo Sept. 5, 2017, 11:25 a.m. | #3
> -----Original Message-----

> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]

> Sent: Wednesday, August 23, 2017 1:24 PM

> To: dev@dpdk.org

> Cc: Doherty, Declan <declan.doherty@intel.com>; De Lara Guarch, Pablo

> <pablo.de.lara.guarch@intel.com>; akhil.goyal@nxp.com

> Subject: [PATCH] examples/l2fwd-crypto: fix uninitialized errno value

> 

> errno should be initialized to 0 before calling strtol

> 

> Fixes: 1df9c0109f4c ("examples/l2fwd-crypto: parse key parameters")

> Cc: stable@dpdk.org

> 

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>


Applied to dpdk-next-crypto.
Thanks,

Pablo

Patch

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index f020be3..17673a3 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -1088,6 +1088,7 @@  parse_key(uint8_t *data, char *input_arg)
 	unsigned byte_count;
 	char *token;
 
+	errno = 0;
 	for (byte_count = 0, token = strtok(input_arg, ":");
 			(byte_count < MAX_KEY_SIZE) && (token != NULL);
 			token = strtok(NULL, ":")) {