]> granicus.if.org Git - python/commitdiff
Issue #6093: Fix off-by-one error in locale.strxfrm.
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 23 May 2009 10:38:26 +0000 (10:38 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 23 May 2009 10:38:26 +0000 (10:38 +0000)
Misc/NEWS
Modules/_localemodule.c

index 19e2deac9c11f956f6583a6b83394314b1885c29..611dbeae335dedf3e18e225c788eeb42823fc1b6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -54,6 +54,11 @@ Library
   now it does.  This also means getfp method now returns the real fp.
 
 
+Extension Modules
+-----------------
+
+- Issue #6093: Fix off-by-one error in locale.strxfrm.
+
 Tests
 -----
 
index 432df36973ddcb1cacce87a6a70c0548707c2afc..50378a72860a9b7a7baeaf93454338d7610c006b 100644 (file)
@@ -314,7 +314,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
             PyErr_NoMemory();
             goto exit;
         }
-        n2 = wcsxfrm(buf, s, n2);
+        n2 = wcsxfrm(buf, s, n2+1);
     }
     result = PyUnicode_FromWideChar(buf, n2);
  exit: