Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/net out-of-bounds access. from openbsd



details:   https://anonhg.NetBSD.org/src/rev/6a9227759198
branches:  trunk
changeset: 552283:6a9227759198
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Sep 23 03:19:28 2003 +0000

description:
out-of-bounds access.  from openbsd

diffstat:

 lib/libc/net/ns_ntoa.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 17a36d0f0094 -r 6a9227759198 lib/libc/net/ns_ntoa.c
--- a/lib/libc/net/ns_ntoa.c    Tue Sep 23 01:52:41 2003 +0000
+++ b/lib/libc/net/ns_ntoa.c    Tue Sep 23 03:19:28 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ns_ntoa.c,v 1.11 2003/08/07 16:43:12 agc Exp $ */
+/*     $NetBSD: ns_ntoa.c,v 1.12 2003/09/23 03:19:28 itojun Exp $      */
 
 /*
  * Copyright (c) 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)ns_ntoa.c  8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: ns_ntoa.c,v 1.11 2003/08/07 16:43:12 agc Exp $");
+__RCSID("$NetBSD: ns_ntoa.c,v 1.12 2003/09/23 03:19:28 itojun Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -62,7 +62,8 @@
        sprintf(obuf, "%x", ntohl(net.long_e));
        cp = spectHex(obuf);
        cp2 = cp + 1;
-       while (*up==0 && up < uplim) up++;
+       while (up < uplim && *up==0)
+               up++;
        if (up == uplim) {
                if (port) {
                        sprintf(cp, ".0");



Home | Main Index | Thread Index | Old Index