Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/lib/libc/net Pull up revision 1.58 (requested by bad in...



details:   https://anonhg.NetBSD.org/src/rev/1d402c051806
branches:  netbsd-1-6
changeset: 530857:1d402c051806
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Oct 11 23:24:59 2003 +0000

description:
Pull up revision 1.58 (requested by bad in ticket #1521):
Back out rev. 1.56; `pointer points the byte just after the valid region'
is normal case.  If the parser wants something more, there should be
another bounds check for it.

diffstat:

 lib/libc/net/gethnamaddr.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 7fdfd5810eb9 -r 1d402c051806 lib/libc/net/gethnamaddr.c
--- a/lib/libc/net/gethnamaddr.c        Fri Oct 10 18:07:14 2003 +0000
+++ b/lib/libc/net/gethnamaddr.c        Sat Oct 11 23:24:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gethnamaddr.c,v 1.42.2.11 2003/10/04 08:42:55 tron Exp $       */
+/*     $NetBSD: gethnamaddr.c,v 1.42.2.12 2003/10/11 23:24:59 tron Exp $       */
 
 /*
  * ++Copyright++ 1985, 1988, 1993
@@ -61,7 +61,7 @@
 static char sccsid[] = "@(#)gethostnamadr.c    8.1 (Berkeley) 6/4/93";
 static char rcsid[] = "Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp ";
 #else
-__RCSID("$NetBSD: gethnamaddr.c,v 1.42.2.11 2003/10/04 08:42:55 tron Exp $");
+__RCSID("$NetBSD: gethnamaddr.c,v 1.42.2.12 2003/10/11 23:24:59 tron Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -203,16 +203,16 @@
 
 #define BOUNDED_INCR(x) \
        do { \
-               if (cp + (x) >= eom) { \
+               cp += (x); \
+               if (cp > eom) { \
                        h_errno = NO_RECOVERY; \
                        return (NULL); \
                } \
-               cp += (x); \
        } while (/*CONSTCOND*/0)
 
 #define BOUNDS_CHECK(ptr, count) \
        do { \
-               if ((ptr) + (count) >= eom) { \
+               if ((ptr) + (count) > eom) { \
                        h_errno = NO_RECOVERY; \
                        return (NULL); \
                } \



Home | Main Index | Thread Index | Old Index