Source-Changes-HG archive

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

[src/trunk]: src/sys/net prevent integer oveflow. From Maksymilian Arciemowicz



details:   https://anonhg.NetBSD.org/src/rev/ee34ff589595
branches:  trunk
changeset: 757799:ee34ff589595
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 23 21:16:42 2010 +0000

description:
prevent integer oveflow. From Maksymilian Arciemowicz

diffstat:

 sys/net/if.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r e1f63b8cb2a4 -r ee34ff589595 sys/net/if.c
--- a/sys/net/if.c      Thu Sep 23 17:40:23 2010 +0000
+++ b/sys/net/if.c      Thu Sep 23 21:16:42 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.244 2010/06/12 08:12:03 skrll Exp $   */
+/*     $NetBSD: if.c,v 1.245 2010/09/23 21:16:42 christos Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.244 2010/06/12 08:12:03 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.245 2010/09/23 21:16:42 christos Exp $");
 
 #include "opt_inet.h"
 
@@ -981,7 +981,7 @@
 
        unit = 0;
        while (cp - name < IFNAMSIZ && *cp) {
-               if (*cp < '0' || *cp > '9' || unit > INT_MAX / 10) {
+               if (*cp < '0' || *cp > '9' || unit >= INT_MAX / 10) {
                        /* Bogus unit number. */
                        return NULL;
                }



Home | Main Index | Thread Index | Old Index