Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/wsfb CID-1427771: Remove incorrect pre-condition (in...



details:   https://anonhg.NetBSD.org/src/rev/a65f2eafbfa3
branches:  trunk
changeset: 358880:a65f2eafbfa3
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 21 04:20:10 2018 +0000

description:
CID-1427771: Remove incorrect pre-condition (index cannot be 256!)

diffstat:

 sys/dev/wsfb/genfb.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r b68c5f5341d0 -r a65f2eafbfa3 sys/dev/wsfb/genfb.c
--- a/sys/dev/wsfb/genfb.c      Sun Jan 21 04:07:49 2018 +0000
+++ b/sys/dev/wsfb/genfb.c      Sun Jan 21 04:20:10 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfb.c,v 1.61 2017/06/01 02:45:12 chs Exp $ */
+/*     $NetBSD: genfb.c,v 1.62 2018/01/21 04:20:10 christos Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.61 2017/06/01 02:45:12 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.62 2018/01/21 04:20:10 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -611,8 +611,7 @@
 #ifdef GENFB_DEBUG
        aprint_debug("putcmap: %d %d\n",index, count);
 #endif
-       if (cm->index >= 256 || cm->count > 256 ||
-           (cm->index + cm->count) > 256)
+       if (index + count > 256)
                return EINVAL;
        error = copyin(cm->red, &rbuf[index], count);
        if (error)



Home | Main Index | Thread Index | Old Index