summaryrefslogtreecommitdiffstats
path: root/lib/libalias
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2000-08-14 15:24:47 +0000
committerru <ru@FreeBSD.org>2000-08-14 15:24:47 +0000
commit5d654e2338d33c452f651e3a018b7725e93edc16 (patch)
treef1449a4a68414eadcdc728625518b73a580ff72a /lib/libalias
parente8f5de8393c98b0c32602246d41e2181100dcd9d (diff)
downloadFreeBSD-src-5d654e2338d33c452f651e3a018b7725e93edc16.zip
FreeBSD-src-5d654e2338d33c452f651e3a018b7725e93edc16.tar.gz
Fixed PunchFW code segmentation violation bug.
Reported by: Christian Schade <chris@cube.sax.de>
Diffstat (limited to 'lib/libalias')
-rw-r--r--lib/libalias/alias_db.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libalias/alias_db.c b/lib/libalias/alias_db.c
index c531bf7..f304c14 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);
OpenPOWER on IntegriCloud