Skip to content

Commit

Permalink
Fix: prevent segfault in gvm_ssh_public_from_private
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell committed May 13, 2024
1 parent 75f387b commit 456fb94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/sshutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ gvm_ssh_public_from_private (const char *private_key, const char *passphrase)
const char *type;
int ret;

if (private_key == NULL)
return NULL;
decrypted_priv = gvm_ssh_pkcs8_decrypt (private_key, passphrase);
ret = ssh_pki_import_privkey_base64 (decrypted_priv ? decrypted_priv
: private_key,
Expand Down

0 comments on commit 456fb94

Please sign in to comment.