Fix invalid response when closing a file due to non-initialized result value.

pull/134/head
John Safranek 2019-01-23 11:47:59 -08:00
parent df6955866d
commit eecae42f4a
1 changed files with 1 additions and 5 deletions

View File

@ -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;