# HG changeset patch # User Mike Becker # Date 1738425585 -3600 # Node ID fd7a7785c9630892d53226e11c417c24293284bc # Parent bb4e34e77974c063d2897807cd628998b9cfe4b2 fix accidental use of VLA diff -r bb4e34e77974 -r fd7a7785c963 src/process.cpp --- a/src/process.cpp Sat Feb 01 16:40:24 2025 +0100 +++ b/src/process.cpp Sat Feb 01 16:59:45 2025 +0100 @@ -41,6 +41,10 @@ } int process::exec(std::vector args, bool capture) { + if (args.size() > 14) { + fputs("Too many arguments to sub-process.\n", stderr); + return -1; + } m_output.clear(); // fd-pair for the pipe @@ -61,7 +65,7 @@ close(pipefd[0]); // create the execv argument list - char *argv[args.size() + 2] = {}; + char *argv[16]; auto slash = m_path.find_last_of('/'); if (slash == std::string::npos) { argv[0] = m_path.data();