summaryrefslogtreecommitdiffstats
path: root/drivers/usb/input
diff options
context:
space:
mode:
authorHenk <Henk.Vergonet@gmail.com>2005-10-12 15:02:56 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 16:47:44 -0700
commitaf64a5ebb817532965d18b792d6d74afecfb0bcf (patch)
tree7ecbcf59e4a79fdd8bef4e0874aa5abce8b91add /drivers/usb/input
parentb81d34363c0b17c47f4ef63d5888c4f47f315d29 (diff)
downloadkernel-crypto-af64a5ebb817532965d18b792d6d74afecfb0bcf.tar.gz
kernel-crypto-af64a5ebb817532965d18b792d6d74afecfb0bcf.tar.xz
kernel-crypto-af64a5ebb817532965d18b792d6d74afecfb0bcf.zip
[PATCH] USB: Buffer overflow patch for Yealink driver
Just a small patch that fixes a small parameter validation bug. drivers/usb/input/map_to_7segment.h: This patch fixes the broken parameter validation in the char to seg7 conversion. This could cause out-of-bounds memory references. MAINTAINERS: Yealink maintainer info now in sorted order. Documentation/input/yealink.txt: Added a Q&A section that answers some common questions. Signed-off-by: Henk <Henk.Vergonet@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> 006491df1a13f85ad245d1039dfdf20e49c394fd
Diffstat (limited to 'drivers/usb/input')
-rw-r--r--drivers/usb/input/map_to_7segment.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/input/map_to_7segment.h b/drivers/usb/input/map_to_7segment.h
index 52ff27f1512..a424094d9fe 100644
--- a/drivers/usb/input/map_to_7segment.h
+++ b/drivers/usb/input/map_to_7segment.h
@@ -79,7 +79,7 @@ struct seg7_conversion_map {
static inline int map_to_seg7(struct seg7_conversion_map *map, int c)
{
- return c & 0x7f ? map->table[c] : -EINVAL;
+ return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL;
}
#define SEG7_CONVERSION_MAP(_name, _map) \