]> granicus.if.org Git - python/commitdiff
Change the limit on the input size for b2a_base64 to what will fit in
authorGuido van Rossum <guido@python.org>
Tue, 30 Oct 2001 03:00:52 +0000 (03:00 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 30 Oct 2001 03:00:52 +0000 (03:00 +0000)
memory, rather than the standard's 57.

This fixes SF bug #473009.

Modules/binascii.c

index 4ddea5685d990df6709f6e91837f44f3d19557cb..643450cf329f28bbdbe45cf7ada15b0b3775fff4 100644 (file)
@@ -135,7 +135,9 @@ static char table_a2b_base64[] = {
 };
 
 #define BASE64_PAD '='
-#define BASE64_MAXBIN 57       /* Max binary chunk size (76 char line) */
+
+/* Max binary chunk size; limited only by available memory */
+#define BASE64_MAXBIN (INT_MAX/2 - sizeof(PyStringObject))
 
 static unsigned char table_b2a_base64[] =
 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";