diff options
| author | 2015-10-21 14:38:03 +0100 | |
|---|---|---|
| committer | 2015-10-22 14:37:06 +0000 | |
| commit | 4c971c001f401d7742db326c8e5654693eb3687e (patch) | |
| tree | fbe7fd128b4a7521bb328dfb2f708034d0a2d848 /include/input/KeyCharacterMap.h | |
| parent | 99497cd85b75667adc4b546f3570b91982959163 (diff) | |
Limit the number of keys read by KeyCharacterMaps.
Apps can send us a KCM containing a ridiculous key count, which will
cause us to crash when an allocation fails. Limit the key count so this
doesn't happen.
Bug: 24876135
Change-Id: I2bb4a5acabfc9184a867a406eef756c28c28f0ad
Diffstat (limited to 'include/input/KeyCharacterMap.h')
| -rw-r--r-- | include/input/KeyCharacterMap.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/input/KeyCharacterMap.h b/include/input/KeyCharacterMap.h index eb5840ebfc..79359277c7 100644 --- a/include/input/KeyCharacterMap.h +++ b/include/input/KeyCharacterMap.h @@ -31,6 +31,9 @@ #include <utils/Unicode.h> #include <utils/RefBase.h> +// Maximum number of keys supported by KeyCharacterMaps +#define MAX_KEYS 8192 + namespace android { /** |