Fix an off-by-4 error in qHash with CRC32
I tested only the 64-bit build. The 32-bit build was reading garbage past the end of the strings in some cases. Change-Id: If6d239754e16a17cc4e8bb71e2b7778429dfa7ba Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
parent
a8877f529d
commit
9a747cb5b7
@ -125,7 +125,7 @@ static uint crc32(const Char *ptr, size_t len, uint h)
|
||||
# else
|
||||
p += 4;
|
||||
for ( ; p <= e; p += 4)
|
||||
h = _mm_crc32_u32(h, *reinterpret_cast<const uint *>(p));
|
||||
h = _mm_crc32_u32(h, *reinterpret_cast<const uint *>(p - 4));
|
||||
p -= 4;
|
||||
len = e - p;
|
||||
# endif
|
||||
|
Loading…
Reference in New Issue
Block a user