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
749f2a61
Commit
749f2a61
authored
Mar 14, 2012
by
Matthias Klose
Browse files
Options
Browse Files
Download
Plain Diff
merge heads
parents
17ae6d77
5c8e648a
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
146 additions
and
62 deletions
+146
-62
Doc/faq/programming.rst
Doc/faq/programming.rst
+2
-2
Misc/NEWS
Misc/NEWS
+14
-1
Modules/expat/expat.h
Modules/expat/expat.h
+9
-0
Modules/expat/pyexpatns.h
Modules/expat/pyexpatns.h
+1
-0
Modules/expat/xmlparse.c
Modules/expat/xmlparse.c
+118
-59
Modules/pyexpat.c
Modules/pyexpat.c
+2
-0
No files found.
Doc/faq/programming.rst
View file @
749f2a61
...
...
@@ -794,9 +794,9 @@ My program is too slow. How do I speed it up?
That's a tough one, in general. First, here are a list of things to
remember before diving further:
* Performance characteristics vary ac
c
ross Python implementations. This FAQ
* Performance characteristics vary across Python implementations. This FAQ
focusses on :term:`CPython`.
* Behaviour can vary ac
c
ross operating systems, especially when talking about
* Behaviour can vary across operating systems, especially when talking about
I/O or multi-threading.
* You should always find the hot spots in your program *before* attempting to
optimize any code (see the :mod:`profile` module).
...
...
Misc/NEWS
View file @
749f2a61
...
...
@@ -69,10 +69,23 @@ Extension Modules
scanning, resulting in segfaults.
What's New in Python 3.2.3 release candidate 2?
===============================================
*Release date: XX-Mar-2012*
Library
-------
- 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.
What's New in Python 3.2.3 release candidate 1?
===============================================
*Release date: 24-Feb-201
1
*
*Release date: 24-Feb-201
2
*
Core and Builtins
-----------------
...
...
Modules/expat/expat.h
View file @
749f2a61
...
...
@@ -883,6 +883,15 @@ XMLPARSEAPI(int)
XML_SetParamEntityParsing
(
XML_Parser
parser
,
enum
XML_ParamEntityParsing
parsing
);
/* Sets the hash salt to use for internal hash calculations.
Helps in preventing DoS attacks based on predicting hash
function behavior. This must be called before parsing is started.
Returns 1 if successful, 0 when called after parsing has started.
*/
XMLPARSEAPI
(
int
)
XML_SetHashSalt
(
XML_Parser
parser
,
unsigned
long
hash_salt
);
/* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
XML_GetErrorCode returns information about the error.
*/
...
...
Modules/expat/pyexpatns.h
View file @
749f2a61
...
...
@@ -97,6 +97,7 @@
#define XML_SetEntityDeclHandler PyExpat_XML_SetEntityDeclHandler
#define XML_SetExternalEntityRefHandler PyExpat_XML_SetExternalEntityRefHandler
#define XML_SetExternalEntityRefHandlerArg PyExpat_XML_SetExternalEntityRefHandlerArg
#define XML_SetHashSalt PyExpat_XML_SetHashSalt
#define XML_SetNamespaceDeclHandler PyExpat_XML_SetNamespaceDeclHandler
#define XML_SetNotationDeclHandler PyExpat_XML_SetNotationDeclHandler
#define XML_SetNotStandaloneHandler PyExpat_XML_SetNotStandaloneHandler
...
...
Modules/expat/xmlparse.c
View file @
749f2a61
This diff is collapsed.
Click to expand it.
Modules/pyexpat.c
View file @
749f2a61
...
...
@@ -1150,6 +1150,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
);
...
...
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