From 5b106ecf637a1d1217f253851568291ae45fe8f7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 3 Nov 2012 14:12:45 +0000 Subject: [PATCH] scst, procfs: Fix a potential out-of-range array access (merge r4555 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4580 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/scst_proc.c b/scst/src/scst_proc.c index 26043cca1..6e780bccf 100644 --- a/scst/src/scst_proc.c +++ b/scst/src/scst_proc.c @@ -2386,7 +2386,7 @@ static int scst_dev_handler_type_info_show(struct seq_file *seq, void *v) TRACE_ENTRY(); seq_printf(seq, "%d - %s\n", dev_type->type, - dev_type->type > (int)ARRAY_SIZE(scst_proc_dev_handler_type) + dev_type->type >= (int)ARRAY_SIZE(scst_proc_dev_handler_type) ? "unknown" : scst_proc_dev_handler_type[dev_type->type]); TRACE_EXIT();