mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-29 18:00:18 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user