Mercurial > cpython-lru_cache-weakref
diff Objects/unicodeobject.c @ 30440:784e38abed82 2.3
Backport: Double-fix of crash in Unicode freelist handling.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Tue, 16 Sep 2003 20:30:03 +0000 |
| parents | 21d3b06df793 |
| children | a8a1bef407eb |
line wrap: on
line diff
--- a/Objects/unicodeobject.c Tue Sep 16 07:13:56 2003 +0000 +++ b/Objects/unicodeobject.c Tue Sep 16 20:30:03 2003 +0000 @@ -132,7 +132,7 @@ instead ! */ if (unicode == unicode_empty || (unicode->length == 1 && - unicode->str[0] < 256 && + unicode->str[0] < 256U && unicode_latin1[unicode->str[0]] == unicode)) { PyErr_SetString(PyExc_SystemError, "can't resize shared unicode objects"); @@ -211,6 +211,7 @@ PyErr_NoMemory(); goto onError; } + unicode->str[0] = 0; unicode->str[length] = 0; unicode->length = length; unicode->hash = -1;
