]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Note that length checking on base64_decode is kinda conservative
authorNick Mathewson <nickm@torproject.org>
Mon, 13 Dec 2004 18:38:19 +0000 (18:38 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 13 Dec 2004 18:38:19 +0000 (18:38 +0000)
svn:r3144

src/common/crypto.c

index 66a666e943212ebcc4cb1b041a61d5954dfb8be9..104e8a56e9bfa783f25fe2476628b001999aaf23 100644 (file)
@@ -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)