diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-15 00:27:43 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-15 00:27:43 (GMT) |
commit | 2843aa8f53273c3f937eb60d900d48ff9381ad67 (patch) | |
tree | a24b327e5d50b906ee2809aea99b5b2b2568b2f5 /Modules | |
parent | 82feb1f360c26c78f0c5159609f3f697008a9238 (diff) | |
download | cpython-2843aa8f53273c3f937eb60d900d48ff9381ad67.zip cpython-2843aa8f53273c3f937eb60d900d48ff9381ad67.tar.gz cpython-2843aa8f53273c3f937eb60d900d48ff9381ad67.tar.bz2 |
Merged revisions 77506 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77506 | antoine.pitrou | 2010-01-15 01:18:00 +0100 (ven., 15 janv. 2010) | 4 lines
Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a
1-byte argument. Patch by Victor Stinner.
........
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/binascii.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/binascii.c b/Modules/binascii.c index 51101b4..833283f 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -294,7 +294,7 @@ binascii_b2a_uu(PyObject *self, PyObject *args) } /* We're lazy and allocate to much (fixed up later) */ - if ( (rv=PyBytes_FromStringAndSize(NULL, bin_len*2+2)) == NULL ) { + if ( (rv=PyBytes_FromStringAndSize(NULL, 2 + (bin_len+2)/3*4)) == NULL ) { PyBuffer_Release(&pbin); return NULL; } |