Commit dd1b9372 authored by Andrew Nguyen's avatar Andrew Nguyen Committed by Alexandre Julliard

msvcrt: Null terminate the temporary locale buffer in _create_locale.

Spotted with Valgrind.
parent 92fe8ef3
...@@ -676,6 +676,7 @@ MSVCRT__locale_t MSVCRT__create_locale(int category, const char *locale) ...@@ -676,6 +676,7 @@ MSVCRT__locale_t MSVCRT__create_locale(int category, const char *locale)
lcid[i] = 0; lcid[i] = 0;
else if(p) { else if(p) {
memcpy(buf, locale, p-locale); memcpy(buf, locale, p-locale);
buf[p-locale] = '\0';
lcid[i] = MSVCRT_locale_to_LCID(buf); lcid[i] = MSVCRT_locale_to_LCID(buf);
} else } else
lcid[i] = MSVCRT_locale_to_LCID(locale); lcid[i] = MSVCRT_locale_to_LCID(locale);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment