mirror of
https://github.com/python/cpython.git
synced 2026-01-08 08:22:41 +00:00
Merged revisions 76625 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76625 | amaury.forgeotdarc | 2009-12-01 22:51:04 +0100 (mar., 01 déc. 2009) | 3 lines #7419: Fix a crash on Windows in locale.setlocale() when the category is outside the allowed range. ........
This commit is contained in:
parent
c2e1cb7d36
commit
64f3ca4206
3 changed files with 22 additions and 0 deletions
|
|
@ -133,6 +133,14 @@ PyLocale_setlocale(PyObject* self, PyObject* args)
|
|||
if (!PyArg_ParseTuple(args, "i|z:setlocale", &category, &locale))
|
||||
return NULL;
|
||||
|
||||
#if defined(MS_WINDOWS)
|
||||
if (category < LC_MIN || category > LC_MAX)
|
||||
{
|
||||
PyErr_SetString(Error, "invalid locale category");
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (locale) {
|
||||
/* set locale */
|
||||
result = setlocale(category, locale);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue