mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Fixes Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes
in the hash table internal to the pyexpat module's copy of the expat library to avoid a denial of service due to hash collisions. Patch by David Malcolm with some modifications by the expat project.
This commit is contained in:
commit
70c9c4dca6
5 changed files with 135 additions and 59 deletions
|
@ -1156,6 +1156,8 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
|
|||
else {
|
||||
self->itself = XML_ParserCreate(encoding);
|
||||
}
|
||||
XML_SetHashSalt(self->itself,
|
||||
(unsigned long)_Py_HashSecret.prefix);
|
||||
self->intern = intern;
|
||||
Py_XINCREF(self->intern);
|
||||
PyObject_GC_Track(self);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue