mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
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
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue