mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
- Fix an off-by-one bug in locale.strxfrm().
patch taken from http://bugs.debian.org/416934.
This commit is contained in:
parent
9e56d5beeb
commit
e19e0c21ae
2 changed files with 4 additions and 1 deletions
|
@ -360,7 +360,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
|
|||
buf = PyMem_Malloc(n1);
|
||||
if (!buf)
|
||||
return PyErr_NoMemory();
|
||||
n2 = strxfrm(buf, s, n1);
|
||||
n2 = strxfrm(buf, s, n1) + 1;
|
||||
if (n2 > n1) {
|
||||
/* more space needed */
|
||||
buf = PyMem_Realloc(buf, n2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue