]> err.no Git - linux-2.6/commitdiff
Input: fix potential overflows in driver/input/touchscreen
authorDmitry Torokhov <dtor_core@ameritech.net>
Mon, 26 Jun 2006 05:46:04 +0000 (01:46 -0400)
committerDmitry Torokhov <dtor_core@ameritech.net>
Mon, 26 Jun 2006 05:46:04 +0000 (01:46 -0400)
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>
drivers/input/touchscreen/gunze.c
drivers/input/touchscreen/h3600_ts_input.c
drivers/input/touchscreen/mtouch.c

index 466da190ceeccc804303a205f0750dc6d71c3983..b769b21973b78eff160567c2c27dc4fe5da3bea6 100644 (file)
@@ -129,7 +129,7 @@ static int gunze_connect(struct serio *serio, struct serio_driver *drv)
 
        gunze->serio = serio;
        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->name = "Gunze AHL-51S TouchScreen";
index a595d386312fee511e8adc1d3daabf017080dd31..2de2139f2fed9f9f62ffe9fb2c4c8cebcb1b204d 100644 (file)
@@ -363,7 +363,7 @@ static int h3600ts_connect(struct serio *serio, struct serio_driver *drv)
 
        ts->serio = serio;
        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->phys = ts->phys;
index 1d0d37eeef6e6327d54ed46183d38e36ebbb15b3..8647a905df80a58bd1ce0da4a02e92236ce8fd9c 100644 (file)
@@ -143,7 +143,7 @@ static int mtouch_connect(struct serio *serio, struct serio_driver *drv)
 
        mtouch->serio = serio;
        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->name = "MicroTouch Serial TouchScreen";