summaryrefslogtreecommitdiff
path: root/libarchive/archive_windows.c
diff options
context:
space:
mode:
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>2011-03-17 14:53:33 -0400
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>2011-03-17 14:53:33 -0400
commit524b2a24ec4126f52bbb5f7537327061a19b505c (patch)
treea618d8b876bd4d6422102d159f2b95cccffc65c4 /libarchive/archive_windows.c
parent85277695e6d24c90a7d293788c170a3f8fd19187 (diff)
downloadlibarchive-524b2a24ec4126f52bbb5f7537327061a19b505c.tar.gz
Do not pass 0 to third parameter of ReadFile(), which parameter specify read bytes,
because ReadFile() will not return if the parameter is 0; test_archive_read_close_twice_open_filename did not end. SVN-Revision: 3022
Diffstat (limited to 'libarchive/archive_windows.c')
-rw-r--r--libarchive/archive_windows.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libarchive/archive_windows.c b/libarchive/archive_windows.c
index f613b174..492ced07 100644
--- a/libarchive/archive_windows.c
+++ b/libarchive/archive_windows.c
@@ -677,6 +677,10 @@ __la_read(int fd, void *buf, size_t nbytes)
errno = EBADF;
return (-1);
}
+ /* Do not pass 0 to third parameter of ReadFile(), read bytes.
+ * This will not return to application size. */
+ if (nbytes == 0)
+ return (0);
handle = (HANDLE)_get_osfhandle(fd);
if (GetFileType(handle) == FILE_TYPE_PIPE) {
DWORD sta;