1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-26 01:03:15 +03:00

sftp: Check for NULL path and give correct error

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2017-11-09 11:41:58 +01:00
parent 01994ea302
commit f525fdb2e1

View File

@@ -3088,6 +3088,11 @@ static sftp_attributes sftp_xstat(sftp_session sftp, const char *path,
ssh_buffer buffer; ssh_buffer buffer;
uint32_t id; uint32_t id;
if (path == NULL) {
ssh_set_error_invalid(sftp->session);
return NULL;
}
buffer = ssh_buffer_new(); buffer = ssh_buffer_new();
if (buffer == NULL) { if (buffer == NULL) {
ssh_set_error_oom(sftp->session); ssh_set_error_oom(sftp->session);