diff options
-rw-r--r-- | extensions/ebt_stp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/extensions/ebt_stp.c b/extensions/ebt_stp.c index 0723bee..a1b2c72 100644 --- a/extensions/ebt_stp.c +++ b/extensions/ebt_stp.c @@ -87,7 +87,7 @@ void print_mac_and_mask(const char *mac, const char *mask); uint32_t _tmp2; \ char *_tmp; \ _tmp2 = strtoul(s, &_tmp, 0); \ - if (_tmp) \ + if (*_tmp != '\0') \ return -1; \ if (size == 2) { \ if (_tmp2 >= (1 << 16)) \ @@ -132,6 +132,8 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, long int i; char *end = NULL; + if (c < 'a' || c > ('a' + STP_NUMOPS - 1)) + return 0; flag = 1 << (c - 'a'); check_option(flags, flag); if (check_inverse(optarg)) @@ -219,7 +221,7 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, print_error("Bad STP config sender address"); break; default: - print_error("This shouldn't happen"); + print_error("stp match: this shouldn't happen"); } return 1; } |