legacy: Fix possible null pointer dereference

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-10-01 20:48:17 +02:00
parent 9c3ba94960
commit 80be1d0ee9

View File

@@ -545,6 +545,10 @@ ssh_string publickey_to_string(ssh_public_key pubkey) {
ssh_string key_blob;
int rc;
if (pubkey == NULL) {
return NULL;
}
key = ssh_key_new();
if (key == NULL) {
return NULL;