Source-Changes-HG archive

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

[src/trunk]: src/sys/kern fix off-by-one error in string len check



details:   https://anonhg.NetBSD.org/src/rev/f87bcaf3fa16
branches:  trunk
changeset: 533897:f87bcaf3fa16
user:      drochner <drochner%NetBSD.org@localhost>
date:      Wed Jul 10 19:04:09 2002 +0000

description:
fix off-by-one error in string len check

diffstat:

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

diffs (27 lines):

diff -r 4e08f8a43544 -r f87bcaf3fa16 sys/kern/subr_autoconf.c
--- a/sys/kern/subr_autoconf.c  Wed Jul 10 18:55:34 2002 +0000
+++ b/sys/kern/subr_autoconf.c  Wed Jul 10 19:04:09 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.63 2002/04/15 05:30:12 gmcgarry Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.64 2002/07/10 19:04:09 drochner Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.63 2002/04/15 05:30:12 gmcgarry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.64 2002/07/10 19:04:09 drochner Exp $");
 
 #include "opt_ddb.h"
 
@@ -409,7 +409,7 @@
        lname = strlen(cd->cd_name);
        xunit = number(&num[sizeof(num)], myunit);
        lunit = &num[sizeof(num)] - xunit;
-       if (lname + lunit >= sizeof(dev->dv_xname))
+       if (lname + lunit > sizeof(dev->dv_xname))
                panic("config_attach: device name too long");
 
        /* get memory for all device vars */



Home | Main Index | Thread Index | Old Index