Commit eb37e2e4 authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

msvcrt: Don't read past end of string in _strnicoll/_wcsnicoll.

parent 9aa7a42a
......@@ -694,7 +694,8 @@ int CDECL MSVCRT__strnicoll_l( const char* str1, const char* str2, MSVCRT_size_t
if(!locinfo->lc_handle[MSVCRT_LC_COLLATE])
return strncasecmp(str1, str2, count);
return CompareStringA(locinfo->lc_handle[MSVCRT_LC_COLLATE], NORM_IGNORECASE,
str1, count, str2, count)-CSTR_EQUAL;
str1, MSVCRT_strnlen(str1, count),
str2, MSVCRT_strnlen(str2, count))-CSTR_EQUAL;
}
/*********************************************************************
......
......@@ -151,7 +151,8 @@ int CDECL MSVCRT__wcsnicoll_l(const MSVCRT_wchar_t* str1, const MSVCRT_wchar_t*
if(!locinfo->lc_handle[MSVCRT_LC_COLLATE])
return strncmpiW(str1, str2, count);
return CompareStringW(locinfo->lc_handle[MSVCRT_LC_COLLATE], NORM_IGNORECASE,
str1, count, str2, count)-CSTR_EQUAL;
str1, MSVCRT_wcsnlen(str1, count),
str2, MSVCRT_wcsnlen(str2, count))-CSTR_EQUAL;
}
/*********************************************************************
......
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