* lib/localcharset.c (locale_charset) [WINDOWS_NATIVE]: Don't use the
return value from setlocale if it would lead to a buffer overrun.
+2016-12-02 Bruno Haible <bruno@clisp.org>
+
+ localcharset: Avoid theoretical buffer overrun.
+ * lib/localcharset.c (locale_charset) [WINDOWS_NATIVE]: Don't use the
+ return value from setlocale if it would lead to a buffer overrun.
+
2016-12-01 Bruno Haible <bruno@clisp.org>
Relicense some modules under LGPLv2+.
current_locale = setlocale (LC_CTYPE, NULL);
pdot = strrchr (current_locale, '.');
- if (pdot)
+ if (pdot && 2 + strlen (pdot + 1) + 1 <= sizeof (buf))
sprintf (buf, "CP%s", pdot + 1);
else
{