]> git.puffer.fish Git - mirror/frr.git/commitdiff
2005-07-26 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
authorajs <ajs>
Tue, 26 Jul 2005 14:35:37 +0000 (14:35 +0000)
committerajs <ajs>
Tue, 26 Jul 2005 14:35:37 +0000 (14:35 +0000)
* prefix.c: (ip_masklen) While loop should test that 'pnt' pointer is
  in range before dereferencing it.

[backport candidate]

lib/ChangeLog
lib/prefix.c

index aed287449e9f989a4a98c94bcc31ec34fd588fe6..f67f2c1e521d4f8c01d3fb2d0b1e55a70b92c66b 100644 (file)
@@ -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
index b4347dd222fb290fdcd080cd8756fa3da6a94dd2..1806ac4987d6ade99cbf28b7d1bc68de37fb3440 100644 (file)
@@ -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++;