From 253d49b24f2deeafaf5aaa85be1e9b54562dff0f Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 21:12:21 +0200 Subject: [PATCH] fix: ensure `/dev/null` fd is closed on failure (#47543) * fix: ensure /dev/null fd is closed on failure Co-authored-by: Shelley Vohr * chore: ignore closehandle for windows Co-authored-by: Robo --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr Co-authored-by: Robo --- shell/browser/api/electron_api_utility_process.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/browser/api/electron_api_utility_process.cc b/shell/browser/api/electron_api_utility_process.cc index d9ff0996d91d..b2eb975dacef 100644 --- a/shell/browser/api/electron_api_utility_process.cc +++ b/shell/browser/api/electron_api_utility_process.cc @@ -78,6 +78,9 @@ UtilityProcessWrapper::UtilityProcessWrapper( base::FileHandleMappingVector fds_to_remap; #endif for (const auto& [io_handle, io_type] : stdio) { + if (io_handle == IOHandle::STDIN) + continue; + if (io_type == IOType::IO_PIPE) { #if BUILDFLAG(IS_WIN) HANDLE read = nullptr;