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]
diff --git a/lib/prefix.c b/lib/prefix.c
index b4347dd..1806ac4 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -292,7 +292,7 @@
   pnt = (u_char *) &netmask;
   end = pnt + 4;
 
-  while ((*pnt == 0xff) && pnt < end)
+  while ((pnt < end) && (*pnt == 0xff))
     {
       len+= 8;
       pnt++;