Input: fix potential overflows in driver/input/keyboard
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:
@@ -96,7 +96,7 @@ static int nkbd_connect(struct serio *serio, struct serio_driver *drv)
|
||||
|
||||
nkbd->serio = serio;
|
||||
nkbd->dev = input_dev;
|
||||
sprintf(nkbd->phys, "%s/input0", serio->phys);
|
||||
snprintf(nkbd->phys, sizeof(nkbd->phys), "%s/input0", serio->phys);
|
||||
memcpy(nkbd->keycode, nkbd_keycode, sizeof(nkbd->keycode));
|
||||
|
||||
input_dev->name = "Newton Keyboard";
|
||||
|
Reference in New Issue
Block a user