]> git.karo-electronics.de Git - karo-tx-linux.git/commit
video: fbdev: metronomefb: two harmless off by one bugs
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 30 Jan 2016 14:44:32 +0000 (17:44 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 16 Feb 2016 12:52:43 +0000 (14:52 +0200)
commit17f2e8e1dbe2cae66e99fd1a684db10bde792570
treee795ddcfffa1e92fb59b95a5fca8b0665e2a3534
parent18558cae0272f8fd9647e69d3fec1565a7949865
video: fbdev: metronomefb: two harmless off by one bugs

par->metromem_cmd->args[] is an array of 31 elements of size u16.  Here
we have initialized the first "i" elements and want to set the rest to
zero.

The issue here is that ARRAY_SIZE(par->metromem_cmd->args) is 31 and not
32 as in the original code.  It means that we set ->csum to zero, but
that is harmless because we immediately set it to the correct value on
the next line.

Still, the buffer overflow upsets static checkers so let's correct the
math.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/metronomefb.c