summaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/alps.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/alps.c
parent4854c7b27f0975a2b629f35ea3996d2968eb7c4f (diff)
downloadblackbird-op-linux-08ffce4560e0133e10634b0dd85eecee11257a1c.tar.gz
blackbird-op-linux-08ffce4560e0133e10634b0dd85eecee11257a1c.zip
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/alps.c')
-rw-r--r--drivers/input/mouse/alps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index a0e2e797c6d5..070d75330afd 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -470,7 +470,7 @@ int alps_init(struct psmouse *psmouse)
dev1->keybit[LONG(BTN_BACK)] |= BIT(BTN_BACK);
}
- sprintf(priv->phys, "%s/input1", psmouse->ps2dev.serio->phys);
+ snprintf(priv->phys, sizeof(priv->phys), "%s/input1", psmouse->ps2dev.serio->phys);
dev2->phys = priv->phys;
dev2->name = (priv->i->flags & ALPS_DUALPOINT) ? "DualPoint Stick" : "PS/2 Mouse";
dev2->id.bustype = BUS_I8042;
OpenPOWER on IntegriCloud