summaryrefslogtreecommitdiffstats
path: root/Modules/binascii.c
diff options
context:
space:
mode:
authorPeter Schneider-Kamp <nowonder@nowonder.de>2001-06-07 05:51:36 (GMT)
committerPeter Schneider-Kamp <nowonder@nowonder.de>2001-06-07 05:51:36 (GMT)
commitd895b20da08983caf35d4a5f46a587a20cfe2590 (patch)
tree8f83b9c9d437b1f47e46f3b72b4708f0298a41b2 /Modules/binascii.c
parent22adac50cb00047321d4c5395eb831a9f724e714 (diff)
downloadcpython-d895b20da08983caf35d4a5f46a587a20cfe2590.zip
cpython-d895b20da08983caf35d4a5f46a587a20cfe2590.tar.gz
cpython-d895b20da08983caf35d4a5f46a587a20cfe2590.tar.bz2
This closes bug #430849 (internal error produced by binascii.a2b_base64)
Diffstat (limited to 'Modules/binascii.c')
-rw-r--r--Modules/binascii.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/binascii.c b/Modules/binascii.c
index 85edd04..00a2805 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -335,6 +335,10 @@ binascii_a2b_base64(PyObject *self, PyObject *args)
if ( !PyArg_ParseTuple(args, "t#:a2b_base64", &ascii_data, &ascii_len) )
return NULL;
+ if ( ascii_len == 0) {
+ PyErr_SetString(Error, "Cannot decode empty input");
+ return NULL;
+ }
bin_len = ((ascii_len+3)/4)*3; /* Upper bound, corrected later */
/* Allocate the buffer */