summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorjunior rantila <junior.rantila@gmail.com>2021-10-03 14:06:27 +0200
committerAndreas Kling <kling@serenityos.org>2021-10-23 11:41:18 +0200
commit769091fc1a8d547ea478f06613a0846fb944708c (patch)
treef4812fd9bf1fb9ec2baf57ffe99920a07ac786b1 /Userland/Utilities
parent1071e4cf78bf12affb30b5a5b09ad516044e2f9e (diff)
downloadserenity-769091fc1a8d547ea478f06613a0846fb944708c.zip
watch: VERIFY that command vector ends with nullptr
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/watch.cpp2
1 files changed, 2 insertions, 0 deletions
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<char const*> const& command)
{
+ VERIFY(command[command.size() - 1] == nullptr);
+
if ((errno = posix_spawnp(const_cast<pid_t*>(&child_pid), command[0], nullptr, nullptr, const_cast<char**>(command.data()), environ))) {
exit_code = 1;
perror("posix_spawn");