mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 16:28:54 +00:00
Kernel: Use copy_n_from_user in sys$setkeymap
This commit is contained in:
parent
2139e0a201
commit
1c0e2947d7
Notes:
sideshowbarker
2024-07-18 22:03:01 +09:00
Author: https://github.com/bgianfo
Commit: 1c0e2947d7
Pull-request: https://github.com/SerenityOS/serenity/pull/5454
1 changed files with 5 additions and 5 deletions
|
@ -44,15 +44,15 @@ int Process::sys$setkeymap(Userspace<const Syscall::SC_setkeymap_params*> user_p
|
|||
|
||||
Keyboard::CharacterMapData character_map_data;
|
||||
|
||||
if (!copy_from_user(character_map_data.map, params.map, CHAR_MAP_SIZE * sizeof(u32)))
|
||||
if (!copy_n_from_user(character_map_data.map, params.map, CHAR_MAP_SIZE))
|
||||
return -EFAULT;
|
||||
if (!copy_from_user(character_map_data.shift_map, params.shift_map, CHAR_MAP_SIZE * sizeof(u32)))
|
||||
if (!copy_n_from_user(character_map_data.shift_map, params.shift_map, CHAR_MAP_SIZE))
|
||||
return -EFAULT;
|
||||
if (!copy_from_user(character_map_data.alt_map, params.alt_map, CHAR_MAP_SIZE * sizeof(u32)))
|
||||
if (!copy_n_from_user(character_map_data.alt_map, params.alt_map, CHAR_MAP_SIZE))
|
||||
return -EFAULT;
|
||||
if (!copy_from_user(character_map_data.altgr_map, params.altgr_map, CHAR_MAP_SIZE * sizeof(u32)))
|
||||
if (!copy_n_from_user(character_map_data.altgr_map, params.altgr_map, CHAR_MAP_SIZE))
|
||||
return -EFAULT;
|
||||
if (!copy_from_user(character_map_data.shift_altgr_map, params.shift_altgr_map, CHAR_MAP_SIZE * sizeof(u32)))
|
||||
if (!copy_n_from_user(character_map_data.shift_altgr_map, params.shift_altgr_map, CHAR_MAP_SIZE))
|
||||
return -EFAULT;
|
||||
|
||||
auto map_name = get_syscall_path_argument(params.map_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue