diff options
| author | NIIBE Yutaka <[email protected]> | 2026-05-18 07:59:27 +0200 |
|---|---|---|
| committer | NIIBE Yutaka <[email protected]> | 2026-05-18 07:59:27 +0200 |
| commit | 168212932fb696db116780a342b23cabbcc1b74e (patch) | |
| tree | 3c8df1764795b147de4af5bfcce78516cef83b48 /src/w32-io.c | |
| parent | Support setting attributes for CMS signatures. (diff) | |
| download | gpgme-168212932fb696db116780a342b23cabbcc1b74e.tar.gz gpgme-168212932fb696db116780a342b23cabbcc1b74e.zip | |
io:w32:spawn_sans_helper: Fix inherit of HANDLES to child process.
* src/w32-io.c (_gpgme_io_spawn_sans_helper): Inherit HANDLES
correctly, even when an argument is not modified.
--
Fixes-commit: 64f80903ec9bc8897f9b2dcebb7068c02ff9ae07
GnuPG-bug-id: 7127
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'src/w32-io.c')
| -rw-r--r-- | src/w32-io.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/w32-io.c b/src/w32-io.c index 48f2869f..c01d50eb 100644 --- a/src/w32-io.c +++ b/src/w32-io.c @@ -1474,13 +1474,6 @@ _gpgme_io_spawn_sans_helper (const char *path, char *const spawn_argv[], std_hd++; } - idx = fd_list[i].arg_loc; - if (idx == 0) - continue; - if (idx >= argc) - /* something goes wrong, ignore. */ - continue; - if (!std_hd) { if (inherit_hd < DIM (handles) - 1) @@ -1495,6 +1488,13 @@ _gpgme_io_spawn_sans_helper (const char *path, char *const spawn_argv[], } } + idx = fd_list[i].arg_loc; + if (idx == 0) + continue; + if (idx >= argc) + /* something goes wrong, ignore. */ + continue; + /* Fix the arg at ARG_LOC. */ if (spawn_argv[idx][0] == '-' && spawn_argv[idx][1] == '&') r = snprintf (p, MAX_ARG_STR, "-&" FMT_HD, (uintptr_t)hd); |
