diff options
author | Georg Brandl <georg@python.org> | 2012-02-20 19:54:16 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-02-20 19:54:16 +0100 |
commit | 2daf6ae2495c862adf8bc717bfe9964081ea0b10 (patch) | |
tree | ebd7efe668e4f7842c6d51bdbde47b00f92a57db /Objects/object.c | |
parent | ec1712a1662282c909b4cd4cc0c7486646bc9246 (diff) | |
download | cpython-git-2daf6ae2495c862adf8bc717bfe9964081ea0b10.tar.gz |
Issue #13703: add a way to randomize the hash values of basic types (str, bytes, datetime)
in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated.
The environment variable PYTHONHASHSEED and the new command line flag -R control this
behavior.
Diffstat (limited to 'Objects/object.c')
-rw-r--r-- | Objects/object.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c index ac57cd7e93..0b1c656cc6 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -712,6 +712,8 @@ PyObject_HashNotImplemented(PyObject *v) return -1; } +_Py_HashSecret_t _Py_HashSecret; + long PyObject_Hash(PyObject *v) { |