diff Objects/object.c @ 75066:f4b7ecf8a5f8 3.1

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.
author Georg Brandl <georg@python.org>
date Mon, 20 Feb 2012 19:54:16 +0100
parents bdfbe0b499af
children 4a31f6b11e7a
line wrap: on
line diff
--- a/Objects/object.c	Sat Feb 18 14:42:57 2012 +0100
+++ b/Objects/object.c	Mon Feb 20 19:54:16 2012 +0100
@@ -712,6 +712,8 @@
     return -1;
 }
 
+_Py_HashSecret_t _Py_HashSecret;
+
 long
 PyObject_Hash(PyObject *v)
 {