Skip to content

Commit a92b680

Browse files
committed
bpo-32681: Fix an uninitialized variable in the C implementation of os.dup2
1 parent e76daeb commit a92b680

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix uninitialized variable 'res' in the C implementation of os.dup2. Patch
2+
by Stéphane Wirtel

Modules/posixmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7782,7 +7782,7 @@ static int
77827782
os_dup2_impl(PyObject *module, int fd, int fd2, int inheritable)
77837783
/*[clinic end generated code: output=bc059d34a73404d1 input=c3cddda8922b038d]*/
77847784
{
7785-
int res;
7785+
int res = 0;
77867786
#if defined(HAVE_DUP3) && \
77877787
!(defined(HAVE_FCNTL_H) && defined(F_DUP2FD_CLOEXEC))
77887788
/* dup3() is available on Linux 2.6.27+ and glibc 2.9 */

0 commit comments

Comments
 (0)