Skip to content

Commit

Permalink
Merge pull request #817 from greenbone/get-credentials-segf
Browse files Browse the repository at this point in the history
Fix: prevent segfault in gvm_ssh_public_from_private
  • Loading branch information
mattmundell authored Jun 3, 2024
2 parents 7bcf632 + dbb3f59 commit 0bc8aa5
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 0bc8aa5

Please sign in to comment.