]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
binascii: Fix the base64_encode_nopad() buffer length requirement
authorteor <teor@torproject.org>
Fri, 5 Apr 2019 05:10:36 +0000 (15:10 +1000)
committerteor <teor@torproject.org>
Fri, 5 Apr 2019 05:17:19 +0000 (15:17 +1000)
Comment-only change.

Part of 29660.

src/lib/encoding/binascii.c

index 187df3424383c3630c1912a370d03df77cc45732..fc64e014e7a82bfa0e596fdfe6e3e16a978c9799 100644 (file)
@@ -321,8 +321,10 @@ base64_encode(char *dest, size_t destlen, const char *src, size_t srclen,
   return (int) enclen;
 }
 
-/** As base64_encode, but do not add any internal spaces or external padding
- * to the output stream. */
+/** As base64_encode, but do not add any internal spaces, and remove external
+ * padding from the output stream.
+ * dest must be at least base64_encode_size(srclen, 0), including space for
+ * the removed external padding. */
 int
 base64_encode_nopad(char *dest, size_t destlen,
                     const uint8_t *src, size_t srclen)