Overrun in drivers/input/joystick/db9.c
PATCH 1/1 Overrun in drivers/input/joystick/db9.c
hi,
coverity spotted this overrun (#id 483), we assign db9_mode = &db9_modes[mode]; some lines before, so if we use mode as index again we might get past the array once mode is greater than DB9_MAX_PAD/2, besides this this patch changes the code to what the author possibly intended it to do.
Signed-off-by Eric Sesterhenn <[email protected]>
drivers/input/joystick/db9.c renamed from drivers/input/joystick/db9.c.orig +1 -1
@@ -584,7 +584,7 @@ static struct db9 __init *db9_probe(int goto err_out; } -if (db9_mode[mode].bidirectional && !(pp->modes &PARPORT_MODE_TRISTATE )) { +if (db9_mode->bidirectional && !(pp->modes &PARPORT_MODE_TRISTATE )) {printk (KERN_ERR "db9.c: specified parport is not bidirectional\n" ); err = -EINVAL ; goto err_put_pp;
Dmitry Torokhov
AppliedQuoted 9 lines · Eric Sesterhenn
hi,
coverity spotted this overrun (#id 483), we assign
db9_mode= &db9_modes[mode]; some lines before, so if we use mode as index again we might get past the array once mode is greater than DB9_MAX_PAD/2, besides this this patch changes the code to what the author possibly intended it to do.
Applied, thank you.
Signature · 1 line
Dmitry