summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-10-26 01:52:37 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-10-26 01:52:37 (GMT)
commit561fbf138d30896af3e7afe33f9bc602dda5f2b7 (patch)
tree58e1d9ea5979c53cb547c7a5fd3b925ef75fb18c /Objects
parent3ed238503d7f9764f670794be20c4a4a0011487a (diff)
downloadcpython-561fbf138d30896af3e7afe33f9bc602dda5f2b7.zip
cpython-561fbf138d30896af3e7afe33f9bc602dda5f2b7.tar.gz
cpython-561fbf138d30896af3e7afe33f9bc602dda5f2b7.tar.bz2
SF bug #1054139: serious string hashing error in 2.4b1
_PyString_Resize() readied strings for mutation but did not invalidate the cached hash value.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/stringobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index c87b688..b8e5f41 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -3530,6 +3530,7 @@ _PyString_Resize(PyObject **pv, int newsize)
sv = (PyStringObject *) *pv;
sv->ob_size = newsize;
sv->ob_sval[newsize] = '\0';
+ sv->ob_shash = -1; /* invalidate cached hash value */
return 0;
}