diff options
author | Guido van Rossum <guido@python.org> | 1999-10-19 04:47:13 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-10-19 04:47:13 (GMT) |
commit | eba24bb920339038b473e8714690080009cb0d3a (patch) | |
tree | dd4c12c26f06020a692168c82ae27c789bef952c /Modules | |
parent | 88d23309e937df1cf99e9a649a7b2684fc1159c5 (diff) | |
download | cpython-eba24bb920339038b473e8714690080009cb0d3a.zip cpython-eba24bb920339038b473e8714690080009cb0d3a.tar.gz cpython-eba24bb920339038b473e8714690080009cb0d3a.tar.bz2 |
Fix PR#110 -- bad input ("====") for a2b_base64() caused it to call
_PyString_Resize() with a negative size.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/binascii.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/binascii.c b/Modules/binascii.c index 73dc27a..601169c 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -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; |