From fa123afa0ef752e8645bf695d121da66d8f1382b Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 15 May 2025 21:10:31 +0200 Subject: [PATCH] Reject + sign when checking -ipcfd --- src/ipc/process.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ipc/process.cpp b/src/ipc/process.cpp index bdc541b654..33667883b7 100644 --- a/src/ipc/process.cpp +++ b/src/ipc/process.cpp @@ -55,9 +55,11 @@ public: // in combination with other arguments because the parent process // should be able to control the child process through the IPC protocol // without passing information out of band. - if (!ParseInt32(argv[2], &fd)) { + const auto maybe_fd{ToIntegral(argv[2])}; + if (!maybe_fd) { throw std::runtime_error(strprintf("Invalid -ipcfd number '%s'", argv[2])); } + fd = *maybe_fd; return true; } int connect(const fs::path& data_dir,