diff options
author | brian <brian@cvs.openbsd.org> | 2000-08-15 10:31:01 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 2000-08-15 10:31:01 +0000 |
commit | ccb8aa83a7f2a9963e4438f7f7ce4ccbce7772ff (patch) | |
tree | e94be9df723d3c2b55f38c5637e1f046ebca4768 | |
parent | 65e9730f410cffb698ba89ca2ac5d0016dc95fe1 (diff) |
SIGSEGV fix for FW_PUNCH code (not used in OpenBSD); FreeBSD
-rw-r--r-- | usr.sbin/ppp/ppp/alias_db.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.sbin/ppp/ppp/alias_db.c b/usr.sbin/ppp/ppp/alias_db.c index 19ddbf65469..812ea2253e8 100644 --- a/usr.sbin/ppp/ppp/alias_db.c +++ b/usr.sbin/ppp/ppp/alias_db.c @@ -115,7 +115,7 @@ See HISTORY file for additional revisions. - $OpenBSD: alias_db.c,v 1.13 2000/08/13 22:05:47 brian Exp $ + $OpenBSD: alias_db.c,v 1.14 2000/08/15 10:31:00 brian Exp $ */ @@ -2664,13 +2664,13 @@ static char *fireWallField; /* bool array for entries */ #define fw_setfield(field, num) \ do { \ - (field)[num] = 1; \ + (field)[(num) - fireWallBaseNum] = 1; \ } /*lint -save -e717 */ while(0) /*lint -restore */ #define fw_clrfield(field, num) \ do { \ - (field)[num] = 0; \ + (field)[(num) - fireWallBaseNum] = 0; \ } /*lint -save -e717 */ while(0) /*lint -restore */ -#define fw_tstfield(field, num) ((field)[num]) +#define fw_tstfield(field, num) ((field)[(num) - fireWallBaseNum]) void PacketAliasSetFWBase(unsigned int base, unsigned int num) { @@ -2727,8 +2727,7 @@ PunchFWHole(struct alias_link *link) { fw_tstfield(fireWallField, fwhole); fwhole++) ; - if (fwhole >= fireWallBaseNum + fireWallNumNums || - fw_tstfield(fireWallField, fwhole)) { + if (fwhole == fireWallBaseNum + fireWallNumNums) { for (fwhole = fireWallBaseNum; fwhole < fireWallActiveNum && fw_tstfield(fireWallField, fwhole); |