mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)
The C accelerated _elementtree module now initializes hash randomization salt from _Py_HashSecret instead of libexpat's default CPRNG. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue34623
This commit is contained in:
parent
0185f34ddc
commit
cb5778f00c
4 changed files with 15 additions and 1 deletions
|
|
@ -3272,6 +3272,11 @@ _elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *target,
|
|||
PyErr_NoMemory();
|
||||
return -1;
|
||||
}
|
||||
/* expat < 2.1.0 has no XML_SetHashSalt() */
|
||||
if (EXPAT(SetHashSalt) != NULL) {
|
||||
EXPAT(SetHashSalt)(self->parser,
|
||||
(unsigned long)_Py_HashSecret.expat.hashsalt);
|
||||
}
|
||||
|
||||
if (target) {
|
||||
Py_INCREF(target);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue