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:
@@ -202,7 +202,8 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv)
|
||||
goto fail3;
|
||||
}
|
||||
|
||||
sprintf(cobra->phys[i], "%s/input%d", gameport->phys, i);
|
||||
snprintf(cobra->phys[i], sizeof(cobra->phys[i]),
|
||||
"%s/input%d", gameport->phys, i);
|
||||
|
||||
input_dev->name = "Creative Labs Blaster GamePad Cobra";
|
||||
input_dev->phys = cobra->phys[i];
|
||||
|
||||
Reference in New Issue
Block a user