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.56 (requested by itojun...



details:   https://anonhg.NetBSD.org/src/rev/a2d94cdafc51
branches:  netbsd-1-6
changeset: 530806:a2d94cdafc51
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Oct 04 08:40:42 2003 +0000

description:
Pull up revision 1.56 (requested by itojun in ticket #1509):
off-by-one.  from millert@openbsd

diffstat:

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

diffs (38 lines):

diff -r a14fe8a755ab -r a2d94cdafc51 lib/libc/net/gethnamaddr.c
--- a/lib/libc/net/gethnamaddr.c        Sat Oct 04 08:36:22 2003 +0000
+++ b/lib/libc/net/gethnamaddr.c        Sat Oct 04 08:40:42 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gethnamaddr.c,v 1.42.2.9 2002/08/27 09:23:26 lukem Exp $       */
+/*     $NetBSD: gethnamaddr.c,v 1.42.2.10 2003/10/04 08:40:42 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.9 2002/08/27 09:23:26 lukem Exp $");
+__RCSID("$NetBSD: gethnamaddr.c,v 1.42.2.10 2003/10/04 08:40:42 tron Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -203,16 +203,16 @@
 
 #define BOUNDED_INCR(x) \
        do { \
-               cp += x; \
-               if (cp > eom) { \
+               if (cp + x >= 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