From df1748e1d1496aad8a84e6c2a56d37f7434e3544 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 9 Jun 2023 20:52:54 +0200 Subject: [PATCH] LibWebView: Unbreak spawning WebContent process with valgrind We now check if the WebContent is executable before passing it to the valgrind wrapper. We can't rely on exec() to fail here, since it will always succeed even when passing a bad WebContent path to valgrind. --- Userland/Libraries/LibWebView/ViewImplementation.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibWebView/ViewImplementation.cpp b/Userland/Libraries/LibWebView/ViewImplementation.cpp index 3c0bff806d..faded7ab49 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.cpp +++ b/Userland/Libraries/LibWebView/ViewImplementation.cpp @@ -200,6 +200,10 @@ ErrorOr> ViewImplementation::launch_web ErrorOr result; for (auto const& path : candidate_web_content_paths) { constexpr auto callgrind_prefix_length = 3; + + if (Core::System::access(path, X_OK).is_error()) + continue; + auto arguments = Vector { "valgrind"sv, "--tool=callgrind"sv,