Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/i386 Fix off by one.



details:   https://anonhg.NetBSD.org/src/rev/9859c4f08f0e
branches:  trunk
changeset: 783131:9859c4f08f0e
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Dec 07 04:49:08 2012 +0000

description:
Fix off by one.

diffstat:

 sys/arch/i386/i386/multiboot.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 5d689ebc1c0e -r 9859c4f08f0e sys/arch/i386/i386/multiboot.c
--- a/sys/arch/i386/i386/multiboot.c    Fri Dec 07 03:11:17 2012 +0000
+++ b/sys/arch/i386/i386/multiboot.c    Fri Dec 07 04:49:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: multiboot.c,v 1.21 2011/01/11 12:24:37 gsutre Exp $    */
+/*     $NetBSD: multiboot.c,v 1.22 2012/12/07 04:49:08 msaitoh Exp $   */
 
 /*-
  * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: multiboot.c,v 1.21 2011/01/11 12:24:37 gsutre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: multiboot.c,v 1.22 2012/12/07 04:49:08 msaitoh Exp $");
 
 #include "opt_multiboot.h"
 
@@ -506,7 +506,7 @@
                *cl2 = '\0';
                memcpy(bi.bootpath, cl, MIN(sizeof(bi.bootpath), len));
                *cl2 = old;
-               bi.bootpath[MIN(sizeof(bi.bootpath), len)] = '\0';
+               bi.bootpath[MIN(sizeof(bi.bootpath) - 1, len)] = '\0';
 
                bootinfo_add((struct btinfo_common *)&bi, BTINFO_BOOTPATH,
                    sizeof(struct btinfo_bootpath));



Home | Main Index | Thread Index | Old Index