[or-cvs] Note that length checking on base64_decode is kinda conserv...
Nick Mathewson
nickm at seul.org
Mon Dec 13 18:38:21 UTC 2004
Update of /home/or/cvsroot/tor/src/common
In directory moria.mit.edu:/tmp/cvs-serv27668/src/common
Modified Files:
crypto.c
Log Message:
Note that length checking on base64_decode is kinda conservative
Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/crypto.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- crypto.c 8 Dec 2004 07:20:21 -0000 1.129
+++ crypto.c 13 Dec 2004 18:38:19 -0000 1.130
@@ -1534,6 +1534,10 @@
* 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)
More information about the tor-commits
mailing list