mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-12 15:41:16 +03:00
Check any input username for validity
Check possible inputs of username for malicious code. Signed-off-by: Norbert Pocs <norbertpocs0@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Jakub Jelen
parent
ebcd6eee3c
commit
d97a5930c9
@@ -738,6 +738,11 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
|
||||
ssh_set_error_oom(session);
|
||||
return -1;
|
||||
}
|
||||
rc = ssh_check_username_syntax(session->opts.username);
|
||||
if (rc != SSH_OK) {
|
||||
ssh_set_error_invalid(session);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SSH_OPTIONS_SSH_DIR:
|
||||
|
||||
Reference in New Issue
Block a user