From ae3154aca9573e2f866d9b6253668db01c3f2488 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Sun, 1 Jan 2017 22:59:46 +0000 Subject: [PATCH] Additional syntax check on MAC wildcards. --- src/util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util.c b/src/util.c index c99eb0d..53b4579 100644 --- a/src/util.c +++ b/src/util.c @@ -497,6 +497,10 @@ int parse_hex(char *in, unsigned char *out, int maxlen, sav = in[(j+1)*2]; in[(j+1)*2] = 0; } + /* checks above allow mix of hexdigit and *, which + is illegal. */ + if (strchr(&in[j*2], '*')) + return -1; out[i] = strtol(&in[j*2], NULL, 16); mask = mask << 1; i++;