Additional syntax check on MAC wildcards.

This commit is contained in:
Simon Kelley
2017-01-01 22:59:46 +00:00
parent 3ebe62d1b7
commit ae3154aca9

View File

@@ -497,6 +497,10 @@ int parse_hex(char *in, unsigned char *out, int maxlen,
sav = in[(j+1)*2]; sav = in[(j+1)*2];
in[(j+1)*2] = 0; 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); out[i] = strtol(&in[j*2], NULL, 16);
mask = mask << 1; mask = mask << 1;
i++; i++;