Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+3 -3
+1 -1
drivers/input/touchscreen/gunze.c
··· 129 129 130 130 gunze->serio = serio; 131 131 gunze->dev = input_dev; 132 - sprintf(gunze->phys, "%s/input0", serio->phys); 132 + snprintf(gunze->phys, sizeof(serio->phys), "%s/input0", serio->phys); 133 133 134 134 input_dev->private = gunze; 135 135 input_dev->name = "Gunze AHL-51S TouchScreen";
+1 -1
drivers/input/touchscreen/h3600_ts_input.c
··· 363 363 364 364 ts->serio = serio; 365 365 ts->dev = input_dev; 366 - sprintf(ts->phys, "%s/input0", serio->phys); 366 + snprintf(ts->phys, sizeof(ts->phys), "%s/input0", serio->phys); 367 367 368 368 input_dev->name = "H3600 TouchScreen"; 369 369 input_dev->phys = ts->phys;
+1 -1
drivers/input/touchscreen/mtouch.c
··· 143 143 144 144 mtouch->serio = serio; 145 145 mtouch->dev = input_dev; 146 - sprintf(mtouch->phys, "%s/input0", serio->phys); 146 + snprintf(mtouch->phys, sizeof(mtouch->phys), "%s/input0", serio->phys); 147 147 148 148 input_dev->private = mtouch; 149 149 input_dev->name = "MicroTouch Serial TouchScreen";