Input: gunze - fix out-of-bound array access reported by Adrian Bunk.
authorDmitry Torokhov <dtor_core@ameritech.net>
Sat, 28 May 2005 07:12:00 +0000 (02:12 -0500)
committerDmitry Torokhov <dtor_core@ameritech.net>
Sat, 28 May 2005 07:12:00 +0000 (02:12 -0500)
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/gunze.c

index c9d0a153671c6a4e68dc62820e036b0faacb4bba..53a27e43dd235285d8b4c283c7c12364433ba102 100644 (file)
@@ -68,8 +68,7 @@ static void gunze_process_packet(struct gunze* gunze, struct pt_regs *regs)
 
        if (gunze->idx != GUNZE_MAX_LENGTH || gunze->data[5] != ',' ||
                (gunze->data[0] != 'T' && gunze->data[0] != 'R')) {
-               gunze->data[10] = 0;
-               printk(KERN_WARNING "gunze.c: bad packet: >%s<\n", gunze->data);
+               printk(KERN_WARNING "gunze.c: bad packet: >%.*s<\n", GUNZE_MAX_LENGTH, gunze->data);
                return;
        }