diff options
author | 2014-10-14 03:09:59 +0000 | |
---|---|---|
committer | 2014-10-14 03:09:59 +0000 | |
commit | cae4e5634192163ebe6ece54ab24888a1c1d695b (patch) | |
tree | d5341145e64a9b00cacc1c92d5b6871dd306a800 | |
parent | Rudimentary implementation of the e, x, and z table layout modifiers (diff) | |
download | wireguard-openbsd-cae4e5634192163ebe6ece54ab24888a1c1d695b.tar.xz wireguard-openbsd-cae4e5634192163ebe6ece54ab24888a1c1d695b.zip |
plug a memory leak; from Maxime Villard.
ok djm@
-rw-r--r-- | usr.bin/ssh/ssh-ed25519.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-ed25519.c b/usr.bin/ssh/ssh-ed25519.c index 6e0247b7187..205c9a39ccd 100644 --- a/usr.bin/ssh/ssh-ed25519.c +++ b/usr.bin/ssh/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> * @@ -125,8 +125,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) { |