mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 13:30:31 +00:00
Kernel: Use try_copy_kstring_from_user() in IPv4Socket::ioctl()
This commit is contained in:
parent
584fa525eb
commit
b96ad76cba
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b96ad76cba8
1 changed files with 4 additions and 4 deletions
|
@ -589,11 +589,11 @@ KResult IPv4Socket::ioctl(FileDescription&, unsigned request, Userspace<void*> a
|
|||
if (!copy_from_user(&route, user_route))
|
||||
return EFAULT;
|
||||
|
||||
auto copied_ifname = copy_string_from_user(route.rt_dev, IFNAMSIZ);
|
||||
if (copied_ifname.is_null())
|
||||
return EFAULT;
|
||||
auto ifname_or_error = try_copy_kstring_from_user(route.rt_dev, IFNAMSIZ);
|
||||
if (ifname_or_error.is_error())
|
||||
return ifname_or_error.error();
|
||||
|
||||
auto adapter = NetworkingManagement::the().lookup_by_name(copied_ifname);
|
||||
auto adapter = NetworkingManagement::the().lookup_by_name(ifname_or_error.value()->view());
|
||||
if (!adapter)
|
||||
return ENODEV;
|
||||
|
||||
|
|
Loading…
Reference in a new issue