[dpdk-dev] [PATCH] examples/l2fwd-crypto: fix uninitialized errno value
Hemant Agrawal
hemant.agrawal at nxp.com
Wed Aug 23 14:24:03 CEST 2017
errno should be initialized to 0 before calling strtol
Fixes: 1df9c0109f4c ("examples/l2fwd-crypto: parse key parameters")
Cc: stable at dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
examples/l2fwd-crypto/main.c | 1 +
1 file changed, 1 insertion(+)
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, ":")) {
--
2.7.4
More information about the dev
mailing list