summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorajs <ajs>2005-07-26 14:35:37 +0000
committerajs <ajs>2005-07-26 14:35:37 +0000
commit330009f7b3742462ebd90f9c16f1ab734344b68c (patch)
tree9d3ddbf26da3205989e136cd2b3858c65584ef94 /lib
parentc898775c95a2aad505911eccb6a70a12d4e49f1d (diff)
2005-07-26 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* prefix.c: (ip_masklen) While loop should test that 'pnt' pointer is in range before dereferencing it. [backport candidate]
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog5
-rw-r--r--lib/prefix.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index aed28744..f67f2c1e 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-26 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+ * prefix.c: (ip_masklen) While loop should test that 'pnt' pointer is
+ in range before dereferencing it.
+
2005-06-24 Pawel Worach <pawel.worach@gmail.com>
* getopt.h: add further tests for full getopt declaration on
diff --git a/lib/prefix.c b/lib/prefix.c
index b4347dd2..1806ac49 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -292,7 +292,7 @@ ip_masklen (struct in_addr netmask)
pnt = (u_char *) &netmask;
end = pnt + 4;
- while ((*pnt == 0xff) && pnt < end)
+ while ((pnt < end) && (*pnt == 0xff))
{
len+= 8;
pnt++;