[Python-checkins] r54669 - in python/trunk: Misc/NEWS Modules/_localemodule.c

matthias.klose python-checkins at python.org
Tue Apr 3 06:36:07 CEST 2007


Author: matthias.klose
Date: Tue Apr  3 06:35:59 2007
New Revision: 54669

Modified:
   python/trunk/Misc/NEWS
   python/trunk/Modules/_localemodule.c
Log:
- Fix an off-by-one bug in locale.strxfrm().

  patch taken from http://bugs.debian.org/416934.


Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Tue Apr  3 06:35:59 2007
@@ -681,6 +681,9 @@
 - 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().
+
+
 Tests
 -----
 

Modified: python/trunk/Modules/_localemodule.c
==============================================================================
--- python/trunk/Modules/_localemodule.c	(original)
+++ python/trunk/Modules/_localemodule.c	Tue Apr  3 06:35:59 2007
@@ -360,7 +360,7 @@
     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);


More information about the Python-checkins mailing list