aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick/grip.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2006-06-26 01:45:48 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2006-06-26 01:45:48 -0400
commit10ca4c0a622a942e55dc8a6d57ebd441089c9e38 (patch)
treedcdb84833a46e80ff95fb73b0d1f83b737f3d2b9 /drivers/input/joystick/grip.c
parent08ffce4560e0133e10634b0dd85eecee11257a1c (diff)
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>
Diffstat (limited to 'drivers/input/joystick/grip.c')
-rw-r--r--drivers/input/joystick/grip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c
index 20cb98ac2d79..17a90c436de8 100644
--- a/drivers/input/joystick/grip.c
+++ b/drivers/input/joystick/grip.c
@@ -354,7 +354,8 @@ static int grip_connect(struct gameport *gameport, struct gameport_driver *drv)
354 goto fail3; 354 goto fail3;
355 } 355 }
356 356
357 sprintf(grip->phys[i], "%s/input%d", gameport->phys, i); 357 snprintf(grip->phys[i], sizeof(grip->phys[i]),
358 "%s/input%d", gameport->phys, i);
358 359
359 input_dev->name = grip_name[grip->mode[i]]; 360 input_dev->name = grip_name[grip->mode[i]];
360 input_dev->phys = grip->phys[i]; 361 input_dev->phys = grip->phys[i];