mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Issue #19815: Fix segfault when parsing empty namespace declaration.
Based on patches by Christian Heimes and Vajrasky Kok
This commit is contained in:
commit
8148164353
2 changed files with 9 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue