From 09bfe48615e171189cdc0d11b353e0610c601fc8 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Mon, 7 Jan 2019 14:05:00 -0800 Subject: [PATCH] Get and Put a file that doesn't exist, and their state machines didn't transition to the cleanup state. --- src/wolfsftp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wolfsftp.c b/src/wolfsftp.c index a581131..c5345b5 100644 --- a/src/wolfsftp.c +++ b/src/wolfsftp.c @@ -5965,7 +5965,9 @@ int wolfSSH_SFTP_Get(WOLFSSH* ssh, char* from, if (ret != 0) { WLOG(WS_LOG_SFTP, "Unable to open output file"); ssh->error = WS_BAD_FILE_E; - return WS_FATAL_ERROR; + ret = WS_FATAL_ERROR; + state->state = STATE_GET_CLEANUP; + continue; } state->state = STATE_GET_READ; FALL_THROUGH; @@ -6128,6 +6130,7 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume, WLOG(WS_LOG_SFTP, "Unable to open input file"); ssh->error = WS_BAD_FILE_E; ret = WS_FATAL_ERROR; + state->state = STATE_PUT_CLEANUP; continue; } state->rSz = 0;