summaryrefslogtreecommitdiff
path: root/ssh-ed25519.c
diff options
context:
space:
mode:
authordaniel@openbsd.org <daniel@openbsd.org>2014-10-14 03:09:59 +0000
committerDamien Miller <djm@mindrot.org>2014-10-20 14:40:06 +1100
commit165bc8786299e261706ed60342985f9de93a7461 (patch)
tree5ed0be68328892c8c9765665924426a0e5b89d9a /ssh-ed25519.c
parentb1ba15f3885947c245c2dbfaad0a04ba050abea0 (diff)
upstream commit
plug a memory leak; from Maxime Villard. ok djm@
Diffstat (limited to 'ssh-ed25519.c')
-rw-r--r--ssh-ed25519.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ssh-ed25519.c b/ssh-ed25519.c
index cb87d479..9922816c 100644
--- a/ssh-ed25519.c
+++ b/ssh-ed25519.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-ed25519.c,v 1.4 2014/06/24 01:13:21 djm Exp $ */
+/* $OpenBSD: ssh-ed25519.c,v 1.5 2014/10/14 03:09:59 daniel Exp $ */
/*
* Copyright (c) 2013 Markus Friedl <markus@openbsd.org>
*
@@ -128,8 +128,10 @@ ssh_ed25519_verify(const struct sshkey *key,
r = SSH_ERR_INVALID_FORMAT;
goto out;
}
- if (datalen >= SIZE_MAX - len)
- return SSH_ERR_INVALID_ARGUMENT;
+ if (datalen >= SIZE_MAX - len) {
+ r = SSH_ERR_INVALID_ARGUMENT;
+ goto out;
+ }
smlen = len + datalen;
mlen = smlen;
if ((sm = malloc(smlen)) == NULL || (m = xmalloc(mlen)) == NULL) {