aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2020-07-15 20:31:43 +0200
committerAndreas Schneider <asn@cryptomilk.org>2020-07-16 12:01:04 +0200
commit906cc7e7e95047981677a43743cb7c4aa2bb3aab (patch)
treec9ebf3e3443a305929c40fa34d62458a1589a728
parentf85464b9002c819031951e8bb3fdb6624c4cb906 (diff)
downloadlibssh-906cc7e7e95047981677a43743cb7c4aa2bb3aab.tar.gz
libssh-906cc7e7e95047981677a43743cb7c4aa2bb3aab.tar.xz
libssh-906cc7e7e95047981677a43743cb7c4aa2bb3aab.zip
pki: Avoid memory leak on invalid curve NID
Thanks oss-fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24166 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/pki.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pki.c b/src/pki.c
index 9e28ea6e..a379d6c7 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -1373,6 +1373,8 @@ static int pki_import_pubkey_buffer(ssh_buffer buffer,
nid = pki_key_ecdsa_nid_from_name(ssh_string_get_char(i));
SSH_STRING_FREE(i);
if (nid == -1) {
+ ssh_string_burn(e);
+ SSH_STRING_FREE(e);
goto fail;
}