MemcmpLowercase would not compare the first byte of both input buffers
leading to two non-identical buffers to be considered the same.
Affects SSE_4_1 and SSE_4_2 implementations of SCMemcmpLowercase, as well
as the non-SIMD implementation. SSE_3 and Tile version are not affected.
static inline int
MemcmpLowercase(const void *s1, const void *s2, size_t n)
{
- size_t i;
+ ssize_t i;
/* check backwards because we already tested the first
* 2 to 4 chars. This way we are more likely to detect
* a miss and thus speed up a little... */
- for (i = n - 1; i; i--) {
+ for (i = n - 1; i >= 0; i--) {
if (((uint8_t *)s1)[i] != u8_tolower(*(((uint8_t *)s2)+i)))
return 1;
}