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>
This commit is contained in:
@@ -254,7 +254,7 @@ static int sermouse_connect(struct serio *serio, struct serio_driver *drv)
|
||||
goto fail;
|
||||
|
||||
sermouse->dev = input_dev;
|
||||
sprintf(sermouse->phys, "%s/input0", serio->phys);
|
||||
snprintf(sermouse->phys, sizeof(sermouse->phys), "%s/input0", serio->phys);
|
||||
sermouse->type = serio->id.proto;
|
||||
|
||||
input_dev->name = sermouse_protocols[sermouse->type];
|
||||
|
Reference in New Issue
Block a user