msvcrt: Don't read past end of string in _strncoll/_wcsncoll.
Signed-off-by: Daniel Lehman <dlehman@esri.com> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
91ac8eb00a
commit
368e9f39b4
|
@ -666,7 +666,9 @@ int CDECL MSVCRT__strncoll_l( const char* str1, const char* str2, MSVCRT_size_t
|
|||
|
||||
if(!locinfo->lc_handle[MSVCRT_LC_COLLATE])
|
||||
return strncmp(str1, str2, count);
|
||||
return CompareStringA(locinfo->lc_handle[MSVCRT_LC_COLLATE], 0, str1, count, str2, count)-CSTR_EQUAL;
|
||||
return CompareStringA(locinfo->lc_handle[MSVCRT_LC_COLLATE], 0,
|
||||
str1, MSVCRT_strnlen(str1, count),
|
||||
str2, MSVCRT_strnlen(str2, count))-CSTR_EQUAL;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
|
@ -335,7 +335,9 @@ int CDECL MSVCRT__wcsncoll_l(const MSVCRT_wchar_t* str1, const MSVCRT_wchar_t* s
|
|||
|
||||
if(!locinfo->lc_handle[MSVCRT_LC_COLLATE])
|
||||
return strncmpW(str1, str2, count);
|
||||
return CompareStringW(locinfo->lc_handle[MSVCRT_LC_COLLATE], 0, str1, count, str2, count)-CSTR_EQUAL;
|
||||
return CompareStringW(locinfo->lc_handle[MSVCRT_LC_COLLATE], 0,
|
||||
str1, MSVCRT_wcsnlen(str1, count),
|
||||
str2, MSVCRT_wcsnlen(str2, count))-CSTR_EQUAL;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
Loading…
Reference in New Issue