[tor-commits] [tor/master] Do not leak the 'tag' when trying to read a truncated ed25519 key file

nickm at torproject.org nickm at torproject.org
Mon May 16 12:29:21 UTC 2016


commit ec81329339429182169c27f05c35e86ae9325267
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue May 3 12:52:29 2016 -0400

    Do not leak the 'tag' when trying to read a truncated ed25519 key file
    
    Fix for bug 18956.
---
 changes/bug18956            | 5 +++++
 src/common/crypto_ed25519.c | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/changes/bug18956 b/changes/bug18956
new file mode 100644
index 0000000..0cf10e9
--- /dev/null
+++ b/changes/bug18956
@@ -0,0 +1,5 @@
+  o Minor bugfixes (memory leaks):
+    - Fix a small, uncommon memory leak that could occur when reading a
+      truncated ed25519 key file. Fixes bug 18956; bugfix on 0.2.6.1-alpha.
+
+
diff --git a/src/common/crypto_ed25519.c b/src/common/crypto_ed25519.c
index 6546115..c687a1b 100644
--- a/src/common/crypto_ed25519.c
+++ b/src/common/crypto_ed25519.c
@@ -433,6 +433,7 @@ ed25519_seckey_read_from_file(ed25519_secret_key_t *seckey_out,
     errno = EINVAL;
   }
 
+  tor_free(*tag_out);
   return -1;
 }
 
@@ -472,6 +473,7 @@ ed25519_pubkey_read_from_file(ed25519_public_key_t *pubkey_out,
     errno = EINVAL;
   }
 
+  tor_free(*tag_out);
   return -1;
 }
 





More information about the tor-commits mailing list