Module Name:    src
Committed By:   skrll
Date:           Tue Sep  6 06:27:17 UTC 2016

Modified Files:
        src/sys/dev/hpc: btnmgr.c

Log Message:
Don't read beyond the end of an array


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/hpc/btnmgr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/hpc/btnmgr.c
diff -u src/sys/dev/hpc/btnmgr.c:1.28 src/sys/dev/hpc/btnmgr.c:1.29
--- src/sys/dev/hpc/btnmgr.c:1.28	Fri Jul 25 08:10:37 2014
+++ src/sys/dev/hpc/btnmgr.c	Tue Sep  6 06:27:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: btnmgr.c,v 1.28 2014/07/25 08:10:37 dholland Exp $	*/
+/*	$NetBSD: btnmgr.c,v 1.29 2016/09/06 06:27:17 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1999
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btnmgr.c,v 1.28 2014/07/25 08:10:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btnmgr.c,v 1.29 2016/09/06 06:27:17 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_btnmgr.h"
@@ -205,7 +205,7 @@ btnmgrattach(device_t parent,
 	/*
 	 * install button event listener
 	 */
-	for (id = 0; id <= n_button_config; id++)
+	for (id = 0; id < n_button_config; id++)
 		if (button_config[id].name != NULL)
 			sc->sc_hook_tag = config_hook(CONFIG_HOOK_BUTTONEVENT,
 			    id, CONFIG_HOOK_SHARE,

Reply via email to