From: Peter Schneider-Kamp Date: Thu, 7 Jun 2001 05:51:36 +0000 (+0000) Subject: This closes bug #430849 (internal error produced by binascii.a2b_base64) X-Git-Tag: v2.2a3~1605 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d895b20da08983caf35d4a5f46a587a20cfe2590;p=thirdparty%2FPython%2Fcpython.git This closes bug #430849 (internal error produced by binascii.a2b_base64) --- diff --git a/Modules/binascii.c b/Modules/binascii.c index 85edd044f6e8..00a28052d978 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 */