summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-02-21 16:08:50 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-02-21 16:08:50 (GMT)
commit26da920001941b0cd74981772924a6aab4d2881a (patch)
tree89683553a0a02950f41b652e225b062736ed1ae7 /Objects
parentb69fa1f8b7b935c79b193502358bd59b685afd77 (diff)
downloadcpython-26da920001941b0cd74981772924a6aab4d2881a.zip
cpython-26da920001941b0cd74981772924a6aab4d2881a.tar.gz
cpython-26da920001941b0cd74981772924a6aab4d2881a.tar.bz2
ensure no one tries to hash things before the random seed is found
Diffstat (limited to 'Objects')
-rw-r--r--Objects/stringobject.c1
-rw-r--r--Objects/unicodeobject.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 9e2673d..9d05866 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -1209,6 +1209,7 @@ string_hash(PyStringObject *a)
register unsigned char *p;
register long x;
+ assert(_Py_HashSecret_Initialized);
if (a->ob_shash != -1)
return a->ob_shash;
len = Py_SIZE(a);
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 2f80e59..1df38e8 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -6692,6 +6692,7 @@ unicode_hash(PyUnicodeObject *self)
register Py_UNICODE *p;
register long x;
+ assert(_Py_HashSecret_Initialized);
if (self->hash != -1)
return self->hash;
len = PyUnicode_GET_SIZE(self);