mirror of https://github.com/wolfSSL/wolfssh.git
Initialize the buffer for the path when receving a ReadDir message.
parent
e7e90fc0ce
commit
c6145a452c
|
@ -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 */
|
/* get working directory in the case of receiving non absolute path */
|
||||||
if (r[0] != '/' && r[1] != ':') {
|
if (r[0] != '/' && r[1] != ':') {
|
||||||
char wd[WOLFSSH_MAX_FILENAME];
|
char wd[WOLFSSH_MAX_FILENAME];
|
||||||
|
|
||||||
|
WMEMSET(wd, 0, WOLFSSH_MAX_FILENAME);
|
||||||
if (ssh->sftpDefaultPath) {
|
if (ssh->sftpDefaultPath) {
|
||||||
XSTRNCPY(wd, ssh->sftpDefaultPath, WOLFSSH_MAX_FILENAME - 1);
|
XSTRNCPY(wd, ssh->sftpDefaultPath, WOLFSSH_MAX_FILENAME - 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue