mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
Kernel: Make sure to clear FD sets when preparing for a select
NULL sets can happen, and we don't want to incorrectly return FDs which aren't in the set too.
This commit is contained in:
committed by
Andreas Kling
parent
95893b0d53
commit
ba92c07a75
@@ -1751,9 +1751,9 @@ int Process::sys$select(const Syscall::SC_select_params* params)
|
||||
// FIXME: Return -EINVAL if timeout is invalid.
|
||||
|
||||
auto transfer_fds = [this, nfds] (fd_set* set, auto& vector) -> int {
|
||||
vector.clear_with_capacity();
|
||||
if (!set)
|
||||
return 0;
|
||||
vector.clear_with_capacity();
|
||||
auto bitmap = Bitmap::wrap((byte*)set, FD_SETSIZE);
|
||||
for (int i = 0; i < nfds; ++i) {
|
||||
if (bitmap.get(i)) {
|
||||
|
||||
Reference in New Issue
Block a user