Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(30288)

Unified Diff: Objects/unicodeobject.c

Issue 20538: Segfault in UTF-7 incremental decoder
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_codecs.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Objects/unicodeobject.c Fri Feb 07 17:53:13 2014 +0100
+++ b/Objects/unicodeobject.c Fri Feb 07 19:46:46 2014 +0200
@@ -4459,8 +4459,16 @@
/* return state */
if (consumed) {
if (inShift) {
+ *consumed = startinpos;
+ if (writer.pos != shiftOutStart && writer.maxchar > 127) {
+ PyObject *result = PyUnicode_FromKindAndData(
+ writer.kind, writer.data, shiftOutStart);
+ Py_XDECREF(errorHandler);
+ Py_XDECREF(exc);
+ _PyUnicodeWriter_Dealloc(&writer);
+ return result;
+ }
writer.pos = shiftOutStart; /* back off output */
- *consumed = startinpos;
}
else {
*consumed = s-starts;
« no previous file with comments | « Lib/test/test_codecs.py ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+