diff options
author | Ruslan Ermilov <ru@FreeBSD.org> | 2000-08-14 15:24:47 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@FreeBSD.org> | 2000-08-14 15:24:47 +0000 |
commit | a05f06d79f673119374c2b393611ec5b5b5a6315 (patch) | |
tree | ce589b377f9cf1e1334b25dc8821b704217c41e6 /lib/libalias | |
parent | b834663f4777a78593c98274081d27fa04ab486d (diff) | |
download | src-a05f06d79f673119374c2b393611ec5b5b5a6315.tar.gz src-a05f06d79f673119374c2b393611ec5b5b5a6315.zip |
Fixed PunchFW code segmentation violation bug.
Reported by: Christian Schade <chris@cube.sax.de>
Notes
Notes:
svn path=/head/; revision=64644
Diffstat (limited to 'lib/libalias')
-rw-r--r-- | lib/libalias/alias_db.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libalias/alias_db.c b/lib/libalias/alias_db.c index c531bf72ec04..f304c14e2b01 100644 --- a/lib/libalias/alias_db.c +++ b/lib/libalias/alias_db.c @@ -2617,13 +2617,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) { @@ -2680,8 +2680,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); |