From 5b6f99bd5f3b0a96ef1f8a7dedc0a964c47aed07 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Thu, 17 Jul 2003 21:54:19 +0000 Subject: *** empty log message *** --- userspace/ebtables2/extensions/ebt_stp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/userspace/ebtables2/extensions/ebt_stp.c b/userspace/ebtables2/extensions/ebt_stp.c index 0723bee..a1b2c72 100644 --- a/userspace/ebtables2/extensions/ebt_stp.c +++ b/userspace/ebtables2/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; } -- cgit v1.2.3