Kaydet (Commit) 5d2d2ef1 authored tarafından Matthias Klose's avatar Matthias Klose

- Fix an off-by-one bug in locale.strxfrm().

  Patch taken from http://bugs.debian.org/416934.
üst 95289052
......@@ -220,6 +220,8 @@ Extension Modules
- Bug #1633621: if curses.resizeterm() or curses.resize_term() is called,
update _curses.LINES, _curses.COLS, curses.LINES and curses.COLS.
- Fix an off-by-one bug in locale.strxfrm().
Library
-------
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment