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
9e9d689d
Commit
9e9d689d
authored
Oct 04, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PyUnicode_New() sets utf8_length to zero for latin1
parent
01698045
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
Objects/unicodeobject.c
Objects/unicodeobject.c
+5
-2
No files found.
Objects/unicodeobject.c
View file @
9e9d689d
...
...
@@ -755,7 +755,7 @@ PyUnicode_New(Py_ssize_t size, Py_UCS4 maxchar)
PyCompactUnicodeObject
*
unicode
;
void
*
data
;
int
kind_state
;
int
is_sharing
=
0
,
is_ascii
=
0
;
int
is_sharing
,
is_ascii
;
Py_ssize_t
char_size
;
Py_ssize_t
struct_size
;
...
...
@@ -769,6 +769,8 @@ PyUnicode_New(Py_ssize_t size, Py_UCS4 maxchar)
++
unicode_new_new_calls
;
#endif
is_ascii
=
0
;
is_sharing
=
0
;
struct_size
=
sizeof
(
PyCompactUnicodeObject
);
if
(
maxchar
<
128
)
{
kind_state
=
PyUnicode_1BYTE_KIND
;
...
...
@@ -833,11 +835,12 @@ PyUnicode_New(Py_ssize_t size, Py_UCS4 maxchar)
((
char
*
)
data
)[
size
]
=
0
;
_PyUnicode_WSTR
(
unicode
)
=
NULL
;
_PyUnicode_WSTR_LENGTH
(
unicode
)
=
0
;
unicode
->
utf8_length
=
0
;
unicode
->
utf8
=
NULL
;
unicode
->
utf8_length
=
0
;
}
else
{
unicode
->
utf8
=
NULL
;
unicode
->
utf8_length
=
0
;
if
(
kind_state
==
PyUnicode_2BYTE_KIND
)
((
Py_UCS2
*
)
data
)[
size
]
=
0
;
else
/* kind_state == PyUnicode_4BYTE_KIND */
...
...
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