Commit eba24bb9 authored by Guido van Rossum's avatar Guido van Rossum

Fix PR#110 -- bad input ("====") for a2b_base64() caused it to call

_PyString_Resize() with a negative size.
parent 88d23309
......@@ -384,6 +384,8 @@ binascii_a2b_base64(self, args)
}
/* and remove any padding */
bin_len -= npad;
if (bin_len < 0)
bin_len = 0;
/* and set string size correctly */
_PyString_Resize(&rv, bin_len);
return rv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment