diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-06-26 07:46:17 +0200 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-06-26 07:46:17 +0200 |
commit | ea08c6faa0a8dc93b016663de55e49822ed0b33f (patch) | |
tree | a1cc8a448e87457c8f8ed45d5f9f430369eb4062 /drivers/input/keyboard/lkkbd.c | |
parent | Input: fix potential overflows in driver/input/touchscreen (diff) | |
download | linux-ea08c6faa0a8dc93b016663de55e49822ed0b33f.tar.xz linux-ea08c6faa0a8dc93b016663de55e49822ed0b33f.zip |
Input: fix potential overflows in driver/input/keyboard
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>
Diffstat (limited to 'drivers/input/keyboard/lkkbd.c')
-rw-r--r-- | drivers/input/keyboard/lkkbd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/input/keyboard/lkkbd.c b/drivers/input/keyboard/lkkbd.c index 77c4d9669ad0..5174224cadb4 100644 --- a/drivers/input/keyboard/lkkbd.c +++ b/drivers/input/keyboard/lkkbd.c @@ -384,18 +384,21 @@ lkkbd_detection_done (struct lkkbd *lk) */ switch (lk->id[4]) { case 1: - sprintf (lk->name, "DEC LK201 keyboard"); + strlcpy (lk->name, "DEC LK201 keyboard", + sizeof (lk->name)); if (lk201_compose_is_alt) lk->keycode[0xb1] = KEY_LEFTALT; break; case 2: - sprintf (lk->name, "DEC LK401 keyboard"); + strlcpy (lk->name, "DEC LK401 keyboard", + sizeof (lk->name)); break; default: - sprintf (lk->name, "Unknown DEC keyboard"); + strlcpy (lk->name, "Unknown DEC keyboard", + sizeof (lk->name)); printk (KERN_ERR "lkkbd: keyboard on %s is unknown, " "please report to Jan-Benedict Glaw " "<jbglaw@lug-owl.de>\n", lk->phys); |