Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/net check for pointer overwrap



details:   https://anonhg.NetBSD.org/src/rev/52a7803d4880
branches:  trunk
changeset: 535368:52a7803d4880
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Aug 16 12:10:37 2002 +0000

description:
check for pointer overwrap

diffstat:

 lib/libc/net/inet_neta.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 3a9279947cd0 -r 52a7803d4880 lib/libc/net/inet_neta.c
--- a/lib/libc/net/inet_neta.c  Fri Aug 16 12:05:01 2002 +0000
+++ b/lib/libc/net/inet_neta.c  Fri Aug 16 12:10:37 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet_neta.c,v 1.13 2002/08/16 12:05:01 itojun Exp $    */
+/*     $NetBSD: inet_neta.c,v 1.14 2002/08/16 12:10:37 itojun Exp $    */
 
 /*
  * Copyright (c) 1996 by Internet Software Consortium.
@@ -22,7 +22,7 @@
 #if 0
 static const char rcsid[] = "Id: inet_neta.c,v 8.2 1996/08/08 06:54:44 vixie Exp ";
 #else
-__RCSID("$NetBSD: inet_neta.c,v 1.13 2002/08/16 12:05:01 itojun Exp $");
+__RCSID("$NetBSD: inet_neta.c,v 1.14 2002/08/16 12:10:37 itojun Exp $");
 #endif
 #endif
 
@@ -71,6 +71,8 @@
                return dst;
        }
        ep = dst + size;
+       if (ep <= dst)
+               goto emsgsize;
        while (src & 0xffffffff) {
                u_char b = (u_char)((src & 0xff000000) >> 24);
 



Home | Main Index | Thread Index | Old Index