aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 2de0f3169..b21529823 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1891,8 +1891,10 @@ base32_decode(char *dest, size_t destlen, const char *src, size_t srclen)
for (j = 0; j < srclen; ++j) {
if (src[j] > 0x60 && src[j] < 0x7B) tmp[j] = src[j] - 0x61;
else if (src[j] > 0x31 && src[j] < 0x38) tmp[j] = src[j] - 0x18;
+ else if (src[j] > 0x40 && src[j] < 0x5B) tmp[j] = src[j] - 0x41;
else {
log_warn(LD_BUG, "illegal character in base32 encoded string");
+ tor_free(tmp);
return -1;
}
}