summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-12-13 18:38:19 +0000
committerNick Mathewson <nickm@torproject.org>2004-12-13 18:38:19 +0000
commit8c85c0bef83b75cd5f6126aa9b258097b57bb574 (patch)
treecf4181e60511d830da731d96b1a6df5f3a716a85
parent1e71b838904e44840f6f094104b740fc9c3a759f (diff)
downloadtor-8c85c0bef83b75cd5f6126aa9b258097b57bb574.tar.gz
tor-8c85c0bef83b75cd5f6126aa9b258097b57bb574.zip
Note that length checking on base64_decode is kinda conservative
svn:r3144
-rw-r--r--src/common/crypto.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 66a666e943..104e8a56e9 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1534,6 +1534,10 @@ base64_encode(char *dest, size_t destlen, const char *src, size_t srclen)
* the result into <b>dest</b>, if it will fit within <b>destlen</b>
* bytes. Return the number of bytes written on success; -1 if
* destlen is too short, or other failure.
+ *
+ * NOTE: destlen should be a little longer than the amount of data it
+ * will contain, since we check for sufficient space conservatively.
+ * Here, "a little" is around 64-ish bytes.
*/
int
base64_decode(char *dest, size_t destlen, const char *src, size_t srclen)