mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
SF bug #1054139: serious string hashing error in 2.4b1
_PyString_Resize() readied strings for mutation but did not invalidate the cached hash value.
This commit is contained in:
parent
3ed238503d
commit
561fbf138d
3 changed files with 11 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue