scst, procfs: Fix a potential out-of-range array access

This patch fixes the following smatch warning:
drivers/scst/scst_proc.c: scst_dev_handler_type_info_show() error: buffer overflow 'scst_proc_dev_handler_type' 16 <= 16

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4555 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-10-10 02:48:15 +00:00
parent 9e1b02afa8
commit b50f3aa7cf

View File

@@ -2378,7 +2378,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();