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
5dd40e55
Commit
5dd40e55
authored
Nov 28, 2013
by
Eli Bendersky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19815: Fix segfault when parsing empty namespace declaration.
Based on patches by Christian Heimes and Vajrasky Kok
parent
c303cfdb
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 @
5dd40e55
...
...
@@ -535,6 +535,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 @
5dd40e55
...
...
@@ -2997,7 +2997,10 @@ expat_start_ns_handler(XMLParserObject* self, const XML_Char* prefix,
PyObject
*
sprefix
=
NULL
;
PyObject
*
suri
=
NULL
;
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