diff options
| author | Kees Cook <[email protected]> | 2023-02-04 19:36:17 +0100 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2023-03-19 22:50:49 +0100 |
| commit | d5872e93fab99e371de97537d7f352cecdf7f92e (patch) | |
| tree | 6e816fe67e985d7e2509188bc3726bb2544138f0 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | de163422206076d764e800486f9c28a0ede7410a (diff) | |
media: mxl5005s: Bounds check size used for max array index
The use of state->CH_Ctrl[i].size in a shift operation implies that its
value can be as much as 32, but the state->CH_Ctrl[i].val array is only
25 in size. Bounds check the size before shifting and looping. Fixes
warnings seen with GCC 13:
../drivers/media/tuners/mxl5005s.c: In function 'MXL_ControlWrite_Group.isra':
../drivers/media/tuners/mxl5005s.c:3450:70: warning: array subscript 32 is above array bounds of 'u16[25]' {aka 'short unsigned int[25]'} [-Warray-bounds=]
3450 | state->CH_Ctrl[i].val[j] = (u8)((value >> j) & 0x01);
| ~~~~~~~~~~~~~~~~~~~~~^~~
../drivers/media/tuners/mxl5005s.c:238:13: note: while referencing 'val'
238 | u16 val[25]; /* Binary representation of Value */
| ^~~
Cc: Colin Ian King <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions