diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c index 14c4430d42..e3bf13d06b 100644 --- a/crypto/compat/posix_win.c +++ b/crypto/compat/posix_win.c @@ -161,6 +161,9 @@ wsa_errno(int err) static int is_socket(int fd) { + /* Border case: Don't break std* file descriptors */ + if (fd < 3) + return 0; return (fd & 1) == 0; /* daringly assumes that any valid socket is even */ }