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
7e4b9057
Commit
7e4b9057
authored
Jan 26, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23321: Fixed a crash in str.decode() when error handler returned
replacment string longer than mailformed input data.
parent
1923b627
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
Misc/NEWS
Misc/NEWS
+3
-0
Objects/unicodeobject.c
Objects/unicodeobject.c
+6
-2
No files found.
Misc/NEWS
View file @
7e4b9057
...
...
@@ -11,6 +11,9 @@ Release date: TBA
Core and Builtins
-----------------
- Issue #23321: Fixed a crash in str.decode() when error handler returned
replacment string longer than mailformed input data.
- Issue #23048: Fix jumping out of an infinite while loop in the pdb.
- Issue #20335: bytes constructor now raises TypeError when encoding or errors
...
...
Objects/unicodeobject.c
View file @
7e4b9057
...
...
@@ -4190,9 +4190,13 @@ unicode_decode_call_errorhandler_writer(
if
(
PyUnicode_READY
(
repunicode
)
<
0
)
goto
onError
;
replen
=
PyUnicode_GET_LENGTH
(
repunicode
);
writer
->
min_length
+=
replen
;
if
(
replen
>
1
)
if
(
replen
>
1
)
{
writer
->
min_length
+=
replen
-
1
;
writer
->
overallocate
=
1
;
if
(
_PyUnicodeWriter_Prepare
(
writer
,
writer
->
min_length
,
PyUnicode_MAX_CHAR_VALUE
(
repunicode
))
==
-
1
)
goto
onError
;
}
if
(
_PyUnicodeWriter_WriteStr
(
writer
,
repunicode
)
==
-
1
)
goto
onError
;
...
...
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