aboutsummaryrefslogtreecommitdiffstats
path: root/common/sysutils.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-06-29 05:04:32 +0000
committerNIIBE Yutaka <[email protected]>2023-06-29 05:04:32 +0000
commit6049d61991a1802e06d5b4aa4906c572ea00a871 (patch)
treeaca57a5b039526ff666553fd420510557bc2ad0e /common/sysutils.c
parentcommon: Raise an error correctly in check_special_filename. (diff)
downloadgnupg-6049d61991a1802e06d5b4aa4906c572ea00a871.tar.gz
gnupg-6049d61991a1802e06d5b4aa4906c572ea00a871.zip
common: Fix the cast for 64-bit Windows.
* common/sysutils.c (translate_sys2libc_fd_int): Fix the cast. -- FD should have a valid value here. For erroneous cases, it must be rejected by argparse handling. GnuPG-bug-id: 6551 Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'common/sysutils.c')
-rw-r--r--common/sysutils.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/common/sysutils.c b/common/sysutils.c
index a780d564f..8a1554a28 100644
--- a/common/sysutils.c
+++ b/common/sysutils.c
@@ -557,17 +557,15 @@ translate_sys2libc_fd (gnupg_fd_t fd, int for_write)
}
/* This is the same as translate_sys2libc_fd but takes an integer
- which is assumed to be such an system handle. On WindowsCE the
- passed FD is a rendezvous ID and the function finishes the pipe
- creation. */
+ which is assumed to be such an system handle. */
int
translate_sys2libc_fd_int (int fd, int for_write)
{
#ifdef HAVE_W32_SYSTEM
if (fd <= 2)
- return fd; /* Do not do this for error, stdin, stdout, stderr. */
+ return fd; /* Do not do this for stdin, stdout, and stderr. */
- return translate_sys2libc_fd ((void*)fd, for_write);
+ return translate_sys2libc_fd ((void*)(intptr_t)fd, for_write);
#else
(void)for_write;
return fd;