mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
Kernel: Use copy_n_from_user in sys$setkeymap
This commit is contained in:
parent
2139e0a201
commit
1c0e2947d7
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