Initialize the buffer for the path when receving a ReadDir message.

pull/215/head
John Safranek 2019-10-29 15:58:08 -07:00
parent e7e90fc0ce
commit c6145a452c
No known key found for this signature in database
GPG Key ID: 8CE817DE0D3CCB4A
1 changed files with 2 additions and 0 deletions

View File

@ -927,6 +927,8 @@ static int wolfSSH_SFTP_RecvRealPath(WOLFSSH* ssh, int reqId, byte* data,
/* get working directory in the case of receiving non absolute path */
if (r[0] != '/' && r[1] != ':') {
char wd[WOLFSSH_MAX_FILENAME];
WMEMSET(wd, 0, WOLFSSH_MAX_FILENAME);
if (ssh->sftpDefaultPath) {
XSTRNCPY(wd, ssh->sftpDefaultPath, WOLFSSH_MAX_FILENAME - 1);
}