mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
SSH-01-006: Add missing NULL checks in ssh_scp_push_file64()
Fixes T193 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@@ -428,7 +428,16 @@ int ssh_scp_push_file64(ssh_scp scp, const char *filename, uint64_t size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
file = ssh_basename(filename);
|
file = ssh_basename(filename);
|
||||||
|
if (file == NULL) {
|
||||||
|
ssh_set_error_oom(scp->session);
|
||||||
|
return SSH_ERROR;
|
||||||
|
}
|
||||||
perms = ssh_scp_string_mode(mode);
|
perms = ssh_scp_string_mode(mode);
|
||||||
|
if (perms == NULL) {
|
||||||
|
SAFE_FREE(file);
|
||||||
|
ssh_set_error_oom(scp->session);
|
||||||
|
return SSH_ERROR;
|
||||||
|
}
|
||||||
SSH_LOG(SSH_LOG_PROTOCOL,
|
SSH_LOG(SSH_LOG_PROTOCOL,
|
||||||
"SCP pushing file %s, size %" PRIu64 " with permissions '%s'",
|
"SCP pushing file %s, size %" PRIu64 " with permissions '%s'",
|
||||||
file, size, perms);
|
file, size, perms);
|
||||||
|
|||||||
Reference in New Issue
Block a user