Input: fix potential overflows in driver/input/joystick
Change all sprintfs into snprintfs to make sure we won't stomp on data adjacent to our buffers. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
@@ -298,7 +298,7 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv)
|
||||
gameport_set_poll_handler(gameport, gf2k_poll);
|
||||
gameport_set_poll_interval(gameport, 20);
|
||||
|
||||
sprintf(gf2k->phys, "%s/input0", gameport->phys);
|
||||
snprintf(gf2k->phys, sizeof(gf2k->phys), "%s/input0", gameport->phys);
|
||||
|
||||
gf2k->length = gf2k_lens[gf2k->id];
|
||||
|
||||
|
Reference in New Issue
Block a user