Fix PR#110 -- bad input ("====") for a2b_base64() caused it to call
_PyString_Resize() with a negative size.
This commit is contained in:
parent
88d23309e9
commit
eba24bb920
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue