diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-01-25 15:16:39 +0200 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2022-01-26 02:37:03 +0200 |
commit | e23d320bb964d166d59f805786f3b7a0a949d2e6 (patch) | |
tree | 80f17c76d3c0d3a9317a557837e687cdb79e3d3a | |
parent | a9cd8ca8410290fbbd3616d7da19edf7c3e46ed0 (diff) | |
download | serenity-e23d320bb964d166d59f805786f3b7a0a949d2e6.zip |
Kernel: Fail gracefully due to OOM on HashTable set in sys$setgroups
-rw-r--r-- | Kernel/Syscalls/setuid.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Syscalls/setuid.cpp b/Kernel/Syscalls/setuid.cpp index 3968422936..992ca2879d 100644 --- a/Kernel/Syscalls/setuid.cpp +++ b/Kernel/Syscalls/setuid.cpp @@ -187,7 +187,7 @@ ErrorOr<FlatPtr> Process::sys$setgroups(size_t count, Userspace<const gid_t*> us HashTable<gid_t> unique_extra_gids; for (auto& extra_gid : new_extra_gids) { if (extra_gid != gid()) - unique_extra_gids.set(extra_gid); + TRY(unique_extra_gids.try_set(extra_gid)); } ProtectedDataMutationScope scope { *this }; |