diff options
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 3b2104d..f181852 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -355,6 +355,9 @@ _read (int fd, void *ptr, size_t len) extern "C" ssize_t _write (int fd, const void *ptr, size_t len) { + if (len == 0) + return 0; + if (__check_invalid_read_ptr_errno (ptr, len)) return -1; |