From eecae42f4a18b919cc9596d49e1f8a2ec66802cb Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 23 Jan 2019 11:47:59 -0800 Subject: [PATCH] Fix invalid response when closing a file due to non-initialized result value. --- src/wolfsftp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/wolfsftp.c b/src/wolfsftp.c index 68cd16b..150d7a0 100644 --- a/src/wolfsftp.c +++ b/src/wolfsftp.c @@ -1469,7 +1469,6 @@ int wolfSSH_SFTP_RecvOpen(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz) /* get reason for opening file */ ato32(data + idx, &reason); idx += UINT32_SZ; - /* @TODO handle attributes */ SFTP_ParseAtributes_buffer(ssh, &atr, data, &idx, maxSz); if ((reason & WOLFSSH_FXF_READ) && (reason & WOLFSSH_FXF_WRITE)) { @@ -1599,14 +1598,11 @@ int wolfSSH_SFTP_RecvOpen(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz) /* get reason for opening file */ ato32(data + idx, &reason); idx += UINT32_SZ; - #if 0 /* @TODO handle attributes */ SFTP_ParseAtributes_buffer(ssh, &atr, data, &idx, maxSz); #endif - WFREE(data, ssh->ctx->heap, DYNTYPE_BUFFER); - if (reason & WOLFSSH_FXF_READ) desiredAccess |= GENERIC_READ; if (reason & WOLFSSH_FXF_WRITE) @@ -2869,7 +2865,7 @@ int wolfSSH_SFTP_RecvClose(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz) HANDLE fd; word32 sz; word32 idx = 0; - int ret; + int ret = WS_SUCCESS; byte* out = NULL; word32 outSz = 0;