summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-10-26 01:52:37 +0000
committerRaymond Hettinger <python@rcn.com>2004-10-26 01:52:37 +0000
commitb03bc9373037f79e5649a40d87a2666f26f0d36b (patch)
tree513c3e99cb23d66bf1644959b81b2628bea58f5a /Objects
parentb188ec6965af285eaf8ce1aa1da315178d00dec9 (diff)
downloadcpython-b03bc9373037f79e5649a40d87a2666f26f0d36b.tar.gz
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 c87b688009..b8e5f41342 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;
}