From b77f1dafb9f35752bb9685323bcacb32a0e6ddc5 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 14 Mar 2002 11:35:58 +0000 Subject: Fix 'iptables -p !' bug (segfault when `!' used without argument) --- extensions/libip6t_owner.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'extensions/libip6t_owner.c') diff --git a/extensions/libip6t_owner.c b/extensions/libip6t_owner.c index 4eed2513..8b511d9e 100644 --- a/extensions/libip6t_owner.c +++ b/extensions/libip6t_owner.c @@ -55,8 +55,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, struct passwd *pwd; struct group *grp; case '1': - if (check_inverse(optarg, &invert)) - optind++; + check_inverse(optarg, &invert, &optind, 0); if ((pwd = getpwnam(optarg))) ownerinfo->uid = pwd->pw_uid; @@ -72,8 +71,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, break; case '2': - if (check_inverse(optarg, &invert)) - optind++; + check_inverse(optarg, &invert, &optind, 0); if ((grp = getgrnam(optarg))) ownerinfo->gid = grp->gr_gid; else { @@ -88,8 +86,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, break; case '3': - if (check_inverse(optarg, &invert)) - optind++; + check_inverse(optarg, &invert, &optind, 0); ownerinfo->pid = strtoul(optarg, &end, 0); if (*end != '\0' || end == optarg) exit_error(PARAMETER_PROBLEM, "Bad OWNER PID value `%s'", optarg); @@ -100,8 +97,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, break; case '4': - if (check_inverse(optarg, &invert)) - optind++; + check_inverse(optarg, &invert, &optind, 0); ownerinfo->sid = strtoul(optarg, &end, 0); if (*end != '\0' || end == optarg) exit_error(PARAMETER_PROBLEM, "Bad OWNER SID value `%s'", optarg); -- cgit v1.2.3