Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c391ad00
Commit
c391ad00
authored
Jan 15, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a
1-byte argument. Patch by Victor Stinner.
parent
3ffa43db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
Lib/test/test_binascii.py
Lib/test/test_binascii.py
+3
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/binascii.c
Modules/binascii.c
+1
-1
No files found.
Lib/test/test_binascii.py
View file @
c391ad00
...
...
@@ -109,6 +109,9 @@ class BinASCIITest(unittest.TestCase):
self
.
assertRaises
(
binascii
.
Error
,
binascii
.
b2a_uu
,
46
*
"!"
)
# Issue #7701 (crash on a pydebug build)
self
.
assertEqual
(
binascii
.
b2a_uu
(
'x'
),
'!>
\
n
'
)
def
test_crc32
(
self
):
crc
=
binascii
.
crc32
(
"Test the CRC-32 of"
)
crc
=
binascii
.
crc32
(
" this string."
,
crc
)
...
...
Misc/NEWS
View file @
c391ad00
...
...
@@ -33,6 +33,9 @@ Core and Builtins
Library
-------
- Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a
1-byte argument. Patch by Victor Stinner.
- Issue #3299: Fix possible crash in the _sre module when given bad
argument values in debug mode. Patch by Victor Stinner.
...
...
Modules/binascii.c
View file @
c391ad00
...
...
@@ -294,7 +294,7 @@ binascii_b2a_uu(PyObject *self, PyObject *args)
}
/* We're lazy and allocate to much (fixed up later) */
if
(
(
rv
=
PyString_FromStringAndSize
(
NULL
,
bin_len
*
2
+
2
))
==
NULL
)
{
if
(
(
rv
=
PyString_FromStringAndSize
(
NULL
,
2
+
(
bin_len
+
2
)
/
3
*
4
))
==
NULL
)
{
PyBuffer_Release
(
&
pbin
);
return
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment