From 769091fc1a8d547ea478f06613a0846fb944708c Mon Sep 17 00:00:00 2001 From: junior rantila Date: Sun, 3 Oct 2021 14:06:27 +0200 Subject: [PATCH] watch: VERIFY that command vector ends with nullptr --- Userland/Utilities/watch.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Utilities/watch.cpp b/Userland/Utilities/watch.cpp index 475984f3d4..4d9f9ce6c3 100644 --- a/Userland/Utilities/watch.cpp +++ b/Userland/Utilities/watch.cpp @@ -67,6 +67,8 @@ static void handle_signal(int signal) static int run_command(Vector const& command) { + VERIFY(command[command.size() - 1] == nullptr); + if ((errno = posix_spawnp(const_cast(&child_pid), command[0], nullptr, nullptr, const_cast(command.data()), environ))) { exit_code = 1; perror("posix_spawn");