Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sun correct integer overrun



details:   https://anonhg.NetBSD.org/src/rev/100b834f9cc8
branches:  trunk
changeset: 536003:100b834f9cc8
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Sep 04 03:58:37 2002 +0000

description:
correct integer overrun

diffstat:

 sys/dev/sun/bt_subr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1ea557631c3a -r 100b834f9cc8 sys/dev/sun/bt_subr.c
--- a/sys/dev/sun/bt_subr.c     Wed Sep 04 03:45:01 2002 +0000
+++ b/sys/dev/sun/bt_subr.c     Wed Sep 04 03:58:37 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt_subr.c,v 1.3 2002/08/06 22:51:45 itojun Exp $ */
+/*     $NetBSD: bt_subr.c,v 1.4 2002/09/04 03:58:37 itojun Exp $ */
 
 /*
  * Copyright (c) 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bt_subr.c,v 1.3 2002/08/06 22:51:45 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bt_subr.c,v 1.4 2002/09/04 03:58:37 itojun Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -148,7 +148,7 @@
 
        start = p->index;
        count = p->count;
-       if (start >= cmsize || start + count > cmsize)
+       if (start >= cmsize || count > cmsize - start)
                return (EINVAL);
 
        if (uspace) {



Home | Main Index | Thread Index | Old Index