Use safer snprintf rather then sprintf in scp_send()
Signed-off-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
parent
8e0cddd01f
commit
4449905ea5
@ -796,8 +796,8 @@ scp_send(LIBSSH2_SESSION * session, const char *path, int mode,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf((char *)session->scpSend_command, "scp -%st ",
|
||||
(mtime || atime)?"p":"");
|
||||
snprintf((char *)session->scpSend_command, session->scpSend_command_len,
|
||||
"scp -%st ", (mtime || atime)?"p":"");
|
||||
|
||||
cmd_len = strlen((char *)session->scpSend_command);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user