[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/3] ed25519: fix leak in pki_ed25519_sign


From 930cad4aa7d8ad6a4bc9072a2712cdf98e1e964d Mon Sep 17 00:00:00 2001
From: Jon Simons <jon@xxxxxxxxxxxxx>
Date: Sat, 27 Sep 2014 02:31:10 -0700
Subject: [PATCH 3/3] ed25519: fix leak in pki_ed25519_sign

Signed-off-by: Jon Simons <jon@xxxxxxxxxxxxx>
---
 src/pki_ed25519.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pki_ed25519.c b/src/pki_ed25519.c
index 918db84..7fb9827 100644
--- a/src/pki_ed25519.c
+++ b/src/pki_ed25519.c
@@ -59,9 +59,9 @@ int pki_ed25519_sign(const ssh_key privkey,
                      const unsigned char *hash,
                      size_t hlen)
 {
-    uint8_t *buffer = malloc(hlen + ED25519_SIG_LEN);
-    unsigned long long dlen = 0;
     int rc;
+    uint8_t *buffer;
+    unsigned long long dlen = 0;
 
     buffer = malloc(hlen + ED25519_SIG_LEN);
     if (buffer == NULL) {
-- 
2.1.1.602.g02f248d


Archive administrator: postmaster@lists.cynapses.org