From: Martin v. Löwis Date: Sat, 23 May 2009 10:38:26 +0000 (+0000) Subject: Issue #6093: Fix off-by-one error in locale.strxfrm. X-Git-Tag: v3.1rc1~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db1c399fe08d8dc74916b3c945c8bc551b00ff7b;p=python Issue #6093: Fix off-by-one error in locale.strxfrm. --- diff --git a/Misc/NEWS b/Misc/NEWS index 19e2deac9c..611dbeae33 100644 --- 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 ----- diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 432df36973..50378a7286 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -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: