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
81481643
Commit
81481643
authored
Nov 28, 2013
by
Eli Bendersky
Browse files
Options
Browse Files
Download
Plain Diff
Issue #19815: Fix segfault when parsing empty namespace declaration.
Based on patches by Christian Heimes and Vajrasky Kok
parents
470fba1f
4b79518f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
Lib/test/test_xml_etree.py
Lib/test/test_xml_etree.py
+5
-0
Modules/_elementtree.c
Modules/_elementtree.c
+4
-1
No files found.
Lib/test/test_xml_etree.py
View file @
81481643
...
...
@@ -526,6 +526,11 @@ class ElementTreeTest(unittest.TestCase):
(
'end-ns'
,
None
),
])
events
=
(
'start-ns'
,
'end-ns'
)
context
=
iterparse
(
io
.
StringIO
(
r"<root xmlns=''/>"
),
events
)
res
=
[
action
for
action
,
elem
in
context
]
self
.
assertEqual
(
res
,
[
'start-ns'
,
'end-ns'
])
events
=
(
"start"
,
"end"
,
"bogus"
)
with
self
.
assertRaises
(
ValueError
)
as
cm
:
with
open
(
SIMPLE_XMLFILE
,
"rb"
)
as
f
:
...
...
Modules/_elementtree.c
View file @
81481643
...
...
@@ -3038,7 +3038,10 @@ expat_start_ns_handler(XMLParserObject* self, const XML_Char* prefix,
if
(
PyErr_Occurred
())
return
;
suri
=
PyUnicode_DecodeUTF8
(
uri
,
strlen
(
uri
),
"strict"
);
if
(
uri
)
suri
=
PyUnicode_DecodeUTF8
(
uri
,
strlen
(
uri
),
"strict"
);
else
suri
=
PyUnicode_FromString
(
""
);
if
(
!
suri
)
return
;
...
...
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