diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-10-15 15:38:44 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-10-15 15:38:44 +0000 |
commit | 7f9e9c816c007fcf474aec213132b173c6f2b571 (patch) | |
tree | 96d066fa5d96d50779586ec77be59747a0c5743c /src/or/test.c | |
parent | 161b85d588b8ca3cffe708c07d9216d8355fbf1e (diff) | |
download | tor-7f9e9c816c007fcf474aec213132b173c6f2b571.tar.gz tor-7f9e9c816c007fcf474aec213132b173c6f2b571.zip |
r15790@catbus: nickm | 2007-10-15 11:38:28 -0400
Fix bug 528: fix memory leak in base32_decode(). While there, also make base32_decode() accept upper-case inputs.
svn:r11946
Diffstat (limited to 'src/or/test.c')
-rw-r--r-- | src/or/test.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/test.c b/src/or/test.c index 9c707099b2..b890959a86 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -3160,6 +3160,12 @@ test_crypto_base32_decode(void) res = base32_decode(decoded, 60, encoded, 96); test_eq(res, 0); test_memeq(plain, decoded, 60); + /* Encode, uppercase, and decode a random string. */ + base32_encode(encoded, 96 + 1, plain, 60); + tor_strupper(encoded); + res = base32_decode(decoded, 60, encoded, 96); + test_eq(res, 0); + test_memeq(plain, decoded, 60); /* Change encoded string and decode. */ if (encoded[0] == 'a') encoded[0] = 'b'; |