Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/net Back out rev. 1.56; `pointer points the byte ju...



details:   https://anonhg.NetBSD.org/src/rev/5eb0352e3967
branches:  trunk
changeset: 553165:5eb0352e3967
user:      enami <enami%NetBSD.org@localhost>
date:      Sat Oct 11 03:35:42 2003 +0000

description:
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 66fb2ac50797 -r 5eb0352e3967 lib/libc/net/gethnamaddr.c
--- a/lib/libc/net/gethnamaddr.c        Sat Oct 11 03:04:34 2003 +0000
+++ b/lib/libc/net/gethnamaddr.c        Sat Oct 11 03:35:42 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gethnamaddr.c,v 1.57 2003/10/03 22:04:44 itojun Exp $  */
+/*     $NetBSD: gethnamaddr.c,v 1.58 2003/10/11 03:35:42 enami Exp $   */
 
 /*
  * ++Copyright++ 1985, 1988, 1993
@@ -57,7 +57,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.57 2003/10/03 22:04:44 itojun Exp $");
+__RCSID("$NetBSD: gethnamaddr.c,v 1.58 2003/10/11 03:35:42 enami Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -194,16 +194,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