From 9d589ea7696e5ac92f8f34932b42ffde4fe47dd2 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Mon, 7 Jan 2019 11:50:15 -0800 Subject: [PATCH] SFTP_SendReadPacket() can return a 0 in normal situations. SFTP_Get() was treating it like an error and skipping the file close. --- src/wolfsftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wolfsftp.c b/src/wolfsftp.c index e16770a..b71994f 100644 --- a/src/wolfsftp.c +++ b/src/wolfsftp.c @@ -5969,7 +5969,7 @@ int wolfSSH_SFTP_Get(WOLFSSH* ssh, char* from, state->handle, state->handleSz, state->gOfst, state->r, WOLFSSH_MAX_SFTP_RW); - if (sz <= 0) { + if (sz < 0) { if (ssh->error == WS_WANT_READ || ssh->error == WS_WANT_WRITE) { return WS_FATAL_ERROR;