mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-10 06:23:01 +03:00
pki: Fix possible segfault in ssh_key_type_from_name().
This commit is contained in:
@@ -178,6 +178,10 @@ const char *ssh_key_type_to_char(enum ssh_keytypes_e type) {
|
||||
* @return The enum ssh key type.
|
||||
*/
|
||||
enum ssh_keytypes_e ssh_key_type_from_name(const char *name) {
|
||||
if (name == NULL) {
|
||||
return SSH_KEYTYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
if (strcmp(name, "rsa1") == 0) {
|
||||
return SSH_KEYTYPE_RSA1;
|
||||
} else if (strcmp(name, "rsa") == 0) {
|
||||
|
Reference in New Issue
Block a user