mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +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:
parent
95893b0d53
commit
ba92c07a75
Notes:
sideshowbarker
2024-07-19 14:02:40 +09:00
Author: https://github.com/rburchell Commit: https://github.com/SerenityOS/serenity/commit/ba92c07a757 Pull-request: https://github.com/SerenityOS/serenity/pull/55
1 changed files with 1 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue