]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
This closes bug #430849 (internal error produced by binascii.a2b_base64)
authorPeter Schneider-Kamp <nowonder@nowonder.de>
Thu, 7 Jun 2001 05:51:36 +0000 (05:51 +0000)
committerPeter Schneider-Kamp <nowonder@nowonder.de>
Thu, 7 Jun 2001 05:51:36 +0000 (05:51 +0000)
Modules/binascii.c

index 85edd044f6e8c51de9d7cb8808eadb11bc71bd16..00a28052d9781a9d44ce992ea23d078aab9c674f 100644 (file)
@@ -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 */