mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Kernel: Use static_ptr_cast to convert between Userspace<T*> types
Some calls of copy_to_user were converting Userspace<T*> to Userspace<U*> via the implicit conversion to FlatPtr. Change them to use the static_ptr_cast overload that is designed to express this conversion
This commit is contained in:
committed by
Andreas Kling
parent
194456efdc
commit
7243bcb7da
@@ -425,7 +425,7 @@ ErrorOr<void> LocalSocket::ioctl(OpenFileDescription& description, unsigned requ
|
||||
switch (request) {
|
||||
case FIONREAD: {
|
||||
int readable = receive_buffer_for(description)->immediately_readable();
|
||||
return copy_to_user(Userspace<int*>(arg), &readable);
|
||||
return copy_to_user(static_ptr_cast<int*>(arg), &readable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user