Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
d1b0ad5a
Commit
d1b0ad5a
authored
Jun 23, 2004
by
Vojtech Pavlik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: Fix array overflows in keyboard.c when KEY_MAX > keycode > NR_KEYS > 128.
Signed-off-by:
Vojtech Pavlik
<
vojtech@suse.cz
>
parent
20c48df4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
drivers/char/keyboard.c
drivers/char/keyboard.c
+5
-2
No files found.
drivers/char/keyboard.c
View file @
d1b0ad5a
...
@@ -124,7 +124,7 @@ int shift_state = 0;
...
@@ -124,7 +124,7 @@ int shift_state = 0;
*/
*/
static
struct
input_handler
kbd_handler
;
static
struct
input_handler
kbd_handler
;
static
unsigned
long
key_down
[
256
/
BITS_PER_LONG
];
/* keyboard key bitmap */
static
unsigned
long
key_down
[
NBITS
(
KEY_MAX
)];
/* keyboard key bitmap */
static
unsigned
char
shift_down
[
NR_SHIFT
];
/* shift state counters.. */
static
unsigned
char
shift_down
[
NR_SHIFT
];
/* shift state counters.. */
static
int
dead_key_next
;
static
int
dead_key_next
;
static
int
npadch
=
-
1
;
/* -1 or number assembled on pad */
static
int
npadch
=
-
1
;
/* -1 or number assembled on pad */
...
@@ -143,7 +143,7 @@ static struct ledptr {
...
@@ -143,7 +143,7 @@ static struct ledptr {
/* Simple translation table for the SysRq keys */
/* Simple translation table for the SysRq keys */
#ifdef CONFIG_MAGIC_SYSRQ
#ifdef CONFIG_MAGIC_SYSRQ
unsigned
char
kbd_sysrq_xlate
[
128
]
=
unsigned
char
kbd_sysrq_xlate
[
KEY_MAX
]
=
"
\000\033
1234567890-=
\177\t
"
/* 0x00 - 0x0f */
"
\000\033
1234567890-=
\177\t
"
/* 0x00 - 0x0f */
"qwertyuiop[]
\r\000
as"
/* 0x10 - 0x1f */
"qwertyuiop[]
\r\000
as"
/* 0x10 - 0x1f */
"dfghjkl;'`
\000\\
zxcv"
/* 0x20 - 0x2f */
"dfghjkl;'`
\000\\
zxcv"
/* 0x20 - 0x2f */
...
@@ -1133,6 +1133,9 @@ void kbd_keycode(unsigned int keycode, int down, int hw_raw, struct pt_regs *reg
...
@@ -1133,6 +1133,9 @@ void kbd_keycode(unsigned int keycode, int down, int hw_raw, struct pt_regs *reg
return
;
return
;
}
}
if
(
keycode
>
NR_KEYS
)
return
;
keysym
=
key_map
[
keycode
];
keysym
=
key_map
[
keycode
];
type
=
KTYP
(
keysym
);
type
=
KTYP
(
keysym
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment