aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/psmouse-base.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2006-06-26 01:45:10 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2006-06-26 01:45:10 -0400
commit08ffce4560e0133e10634b0dd85eecee11257a1c (patch)
treeeff2a0266e0897e72e48db949fb28f367812222e /drivers/input/mouse/psmouse-base.c
parent4854c7b27f0975a2b629f35ea3996d2968eb7c4f (diff)
Input: fix potential overflows in driver/input/mouse
Change all sprintfs into snprintfs to make sure we won't stomp on data adjacent to our buffers. Noticed by Wouter Paesen <wouter@kangaroot.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/psmouse-base.c')
-rw-r--r--drivers/input/mouse/psmouse-base.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 136321a2cfdb..5f21532c24ff 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1057,8 +1057,8 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, struct psmouse_proto
1057 if (psmouse->resync_time && psmouse->poll(psmouse)) 1057 if (psmouse->resync_time && psmouse->poll(psmouse))
1058 psmouse->resync_time = 0; 1058 psmouse->resync_time = 0;
1059 1059
1060 sprintf(psmouse->devname, "%s %s %s", 1060 snprintf(psmouse->devname, sizeof(psmouse->devname), "%s %s %s",
1061 psmouse_protocol_by_type(psmouse->type)->name, psmouse->vendor, psmouse->name); 1061 psmouse_protocol_by_type(psmouse->type)->name, psmouse->vendor, psmouse->name);
1062 1062
1063 input_dev->name = psmouse->devname; 1063 input_dev->name = psmouse->devname;
1064 input_dev->phys = psmouse->phys; 1064 input_dev->phys = psmouse->phys;
@@ -1099,7 +1099,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
1099 ps2_init(&psmouse->ps2dev, serio); 1099 ps2_init(&psmouse->ps2dev, serio);
1100 INIT_WORK(&psmouse->resync_work, psmouse_resync, psmouse); 1100 INIT_WORK(&psmouse->resync_work, psmouse_resync, psmouse);
1101 psmouse->dev = input_dev; 1101 psmouse->dev = input_dev;
1102 sprintf(psmouse->phys, "%s/input0", serio->phys); 1102 snprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys);
1103 1103
1104 psmouse_set_state(psmouse, PSMOUSE_INITIALIZING); 1104 psmouse_set_state(psmouse, PSMOUSE_INITIALIZING);
1105 1105