Input: fix potential overflows in driver/input/touchscreen
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:
parent
10ca4c0a62
commit
a21466cc77
3 changed files with 3 additions and 3 deletions
|
@ -129,7 +129,7 @@ static int gunze_connect(struct serio *serio, struct serio_driver *drv)
|
||||||
|
|
||||||
gunze->serio = serio;
|
gunze->serio = serio;
|
||||||
gunze->dev = input_dev;
|
gunze->dev = input_dev;
|
||||||
sprintf(gunze->phys, "%s/input0", serio->phys);
|
snprintf(gunze->phys, sizeof(serio->phys), "%s/input0", serio->phys);
|
||||||
|
|
||||||
input_dev->private = gunze;
|
input_dev->private = gunze;
|
||||||
input_dev->name = "Gunze AHL-51S TouchScreen";
|
input_dev->name = "Gunze AHL-51S TouchScreen";
|
||||||
|
|
|
@ -363,7 +363,7 @@ static int h3600ts_connect(struct serio *serio, struct serio_driver *drv)
|
||||||
|
|
||||||
ts->serio = serio;
|
ts->serio = serio;
|
||||||
ts->dev = input_dev;
|
ts->dev = input_dev;
|
||||||
sprintf(ts->phys, "%s/input0", serio->phys);
|
snprintf(ts->phys, sizeof(ts->phys), "%s/input0", serio->phys);
|
||||||
|
|
||||||
input_dev->name = "H3600 TouchScreen";
|
input_dev->name = "H3600 TouchScreen";
|
||||||
input_dev->phys = ts->phys;
|
input_dev->phys = ts->phys;
|
||||||
|
|
|
@ -143,7 +143,7 @@ static int mtouch_connect(struct serio *serio, struct serio_driver *drv)
|
||||||
|
|
||||||
mtouch->serio = serio;
|
mtouch->serio = serio;
|
||||||
mtouch->dev = input_dev;
|
mtouch->dev = input_dev;
|
||||||
sprintf(mtouch->phys, "%s/input0", serio->phys);
|
snprintf(mtouch->phys, sizeof(mtouch->phys), "%s/input0", serio->phys);
|
||||||
|
|
||||||
input_dev->private = mtouch;
|
input_dev->private = mtouch;
|
||||||
input_dev->name = "MicroTouch Serial TouchScreen";
|
input_dev->name = "MicroTouch Serial TouchScreen";
|
||||||
|
|
Loading…
Reference in a new issue