We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3031948 commit eae0bc4Copy full SHA for eae0bc4
Modules/_localemodule.c
@@ -89,16 +89,16 @@ copy_grouping(const char* s)
89
90
#if defined(MS_WINDOWS)
91
92
-// The number of elements in the szCodePage field
+// 16 is the number of elements in the szCodePage field
93
// of the __crt_locale_strings structure.
94
-#define MAX_ENCODING_SIZE 16
+#define MAX_CP_LEN 15
95
96
static int
97
check_locale_name(const char *locale, const char *end)
98
{
99
size_t len = end ? (size_t)(end - locale) : strlen(locale);
100
const char *dot = memchr(locale, '.', len);
101
- if (dot && locale + len - dot > MAX_ENCODING_SIZE) {
+ if (dot && locale + len - dot - 1 > MAX_CP_LEN) {
102
return -1;
103
}
104
return 0;
0 commit comments