[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Note that length checking on base64_decode is kinda conserv...
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] Note that length checking on base64_decode is kinda conserv...
- From: nickm@xxxxxxxx (Nick Mathewson)
- Date: Mon, 13 Dec 2004 13:38:21 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Mon, 13 Dec 2004 13:38:41 -0500
- Reply-to: or-dev@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
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)