mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
This closes bug #430849 (internal error produced by binascii.a2b_base64)
This commit is contained in:
parent
22adac50cb
commit
d895b20da0
1 changed files with 4 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue