summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2019-11-25 00:38:17 +0000
committerDamien Miller <djm@mindrot.org>2019-11-25 12:22:43 +1100
commitd2b0f88178ec9e3f11b606bf1004ac2fe541a2c3 (patch)
tree373b47b85c739fd3035824e08de64a4019bc653a
parente2c0a21ade5e0bd7f0aab08d7eb9457f086681e9 (diff)
upstream: memleak in error path
OpenBSD-Commit-ID: 93488431bf02dde85a854429362695d2d43d9112
-rw-r--r--ssh-ecdsa-sk.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ssh-ecdsa-sk.c b/ssh-ecdsa-sk.c
index 0d4d01cac..f33fac714 100644
--- a/ssh-ecdsa-sk.c
+++ b/ssh-ecdsa-sk.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-ecdsa-sk.c,v 1.2 2019/11/19 22:23:19 djm Exp $ */ 1/* $OpenBSD: ssh-ecdsa-sk.c,v 1.3 2019/11/25 00:38:17 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2010 Damien Miller. All rights reserved. 4 * Copyright (c) 2010 Damien Miller. All rights reserved.
@@ -124,8 +124,10 @@ ssh_ecdsa_sk_verify(const struct sshkey *key,
124 } 124 }
125 125
126 /* Reconstruct data that was supposedly signed */ 126 /* Reconstruct data that was supposedly signed */
127 if ((original_signed = sshbuf_new()) == NULL) 127 if ((original_signed = sshbuf_new()) == NULL) {
128 return SSH_ERR_ALLOC_FAIL; 128 ret = SSH_ERR_ALLOC_FAIL;
129 goto out;
130 }
129 if ((ret = ssh_digest_memory(SSH_DIGEST_SHA256, data, datalen, 131 if ((ret = ssh_digest_memory(SSH_DIGEST_SHA256, data, datalen,
130 msghash, sizeof(msghash))) != 0) 132 msghash, sizeof(msghash))) != 0)
131 goto out; 133 goto out;