summaryrefslogtreecommitdiff
path: root/Kernel/GlobalProcessExposed.cpp
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-25 15:19:14 +0200
committerIdan Horowitz <idan.horowitz@gmail.com>2022-01-26 02:37:03 +0200
commitdab73d6d23fd7ee98429a73cc262a8597416c356 (patch)
treeb3ecbd87f3ead4cd5e2e9d28e2a66662a7e59863 /Kernel/GlobalProcessExposed.cpp
parente23d320bb964d166d59f805786f3b7a0a949d2e6 (diff)
downloadserenity-dab73d6d23fd7ee98429a73cc262a8597416c356.zip
Kernel: Make pledge serialization in /proc/all generation OOM-fallible
Diffstat (limited to 'Kernel/GlobalProcessExposed.cpp')
-rw-r--r--Kernel/GlobalProcessExposed.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Kernel/GlobalProcessExposed.cpp b/Kernel/GlobalProcessExposed.cpp
index 4c5d88e2cd..9f4cd2d32a 100644
--- a/Kernel/GlobalProcessExposed.cpp
+++ b/Kernel/GlobalProcessExposed.cpp
@@ -459,10 +459,9 @@ private:
if (process.is_user_process()) {
StringBuilder pledge_builder;
-#define __ENUMERATE_PLEDGE_PROMISE(promise) \
- if (process.has_promised(Pledge::promise)) { \
- pledge_builder.append(#promise " "); \
- }
+#define __ENUMERATE_PLEDGE_PROMISE(promise) \
+ if (process.has_promised(Pledge::promise)) \
+ TRY(pledge_builder.try_append(#promise " "));
ENUMERATE_PLEDGE_PROMISES
#undef __ENUMERATE_PLEDGE_PROMISE