From f0629e29c988faf1a84cd38a6283ab8e3be5ad52 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 6 May 2021 13:34:36 +0200 Subject: [PATCH] LookupServer: Check the return value after calling unveil() --- Userland/Services/LookupServer/main.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Userland/Services/LookupServer/main.cpp b/Userland/Services/LookupServer/main.cpp index 302d4d9495..26db5092bc 100644 --- a/Userland/Services/LookupServer/main.cpp +++ b/Userland/Services/LookupServer/main.cpp @@ -25,8 +25,15 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) return 1; } - unveil("/proc/net/adapters", "r"); - unveil(nullptr, nullptr); + if (unveil("/proc/net/adapters", "r") < 0) { + perror("unveil"); + return 1; + } + + if (unveil(nullptr, nullptr) < 0) { + perror("unveil"); + return 1; + } return event_loop.exec(); }