diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2012-10-07 22:04:58 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-10-07 22:04:58 +0200 |
commit | bfa568e448133501cdb496b3caea2282c7430b85 (patch) | |
tree | c83f7b53aee60112ef94027345c95fb6a4b06893 /src | |
parent | ff53664f540517a6e7c634ae9cc804d168a9e9a8 (diff) | |
download | libssh-bfa568e448133501cdb496b3caea2282c7430b85.tar.gz libssh-bfa568e448133501cdb496b3caea2282c7430b85.tar.xz libssh-bfa568e448133501cdb496b3caea2282c7430b85.zip |
pki: Check for no memory available calling ssh_key_new().
Diffstat (limited to 'src')
-rw-r--r-- | src/pki.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -876,6 +876,10 @@ int ssh_pki_generate(enum ssh_keytypes_e type, int parameter, int rc; ssh_key key = ssh_key_new(); + if (key == NULL) { + return SSH_ERROR; + } + key->type = type; key->type_c = ssh_key_type_to_char(type); key->flags = SSH_KEY_FLAG_PRIVATE | SSH_KEY_FLAG_PUBLIC; |