]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Do not leak the 'tag' when trying to read a truncated ed25519 key file
authorNick Mathewson <nickm@torproject.org>
Tue, 3 May 2016 16:52:29 +0000 (12:52 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 16 May 2016 12:25:59 +0000 (08:25 -0400)
Fix for bug 18956.

changes/bug18956 [new file with mode: 0644]
src/common/crypto_ed25519.c

diff --git a/changes/bug18956 b/changes/bug18956
new file mode 100644 (file)
index 0000000..0cf10e9
--- /dev/null
@@ -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.
+
+
index 654611553e3e25dcd423e80d680ae4884bcd8f99..c687a1b24644fa09424e8502a38432960a174e2a 100644 (file)
@@ -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;
 }