Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/luna68k/dev Fix (mostly harmless) off-by-one size c...



details:   https://anonhg.NetBSD.org/src/rev/9b1636fe614b
branches:  trunk
changeset: 820396:9b1636fe614b
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Jan 08 16:34:44 2017 +0000

description:
Fix (mostly harmless) off-by-one size check in XPIOCDOWNLD ioctl.

Pointed out by Kenji Aoyama.

diffstat:

 sys/arch/luna68k/dev/xp.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 9e650b96131e -r 9b1636fe614b sys/arch/luna68k/dev/xp.c
--- a/sys/arch/luna68k/dev/xp.c Sun Jan 08 16:22:21 2017 +0000
+++ b/sys/arch/luna68k/dev/xp.c Sun Jan 08 16:34:44 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xp.c,v 1.1 2016/12/03 17:38:02 tsutsui Exp $ */
+/* $NetBSD: xp.c,v 1.2 2017/01/08 16:34:44 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2016 Izumi Tsutsui.  All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xp.c,v 1.1 2016/12/03 17:38:02 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xp.c,v 1.2 2017/01/08 16:34:44 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -220,7 +220,7 @@
        case XPIOCDOWNLD:
                downld = addr;
                loadsize = downld->size;
-               if (loadsize == 0 || loadsize >= XP_SHM_SIZE) {
+               if (loadsize == 0 || loadsize > XP_SHM_SIZE) {
                        return EINVAL;
                }
 



Home | Main Index | Thread Index | Old Index