Comment 1 for bug 2001975

Revision history for this message
In , Goldstein-w-n (goldstein-w-n) wrote :

Similiar to [BZ 27974](https://sourceware.org/bugzilla/show_bug.cgi?id=27974). The multiply of length by sizeof (wchar_t) can overflow if length is >= 2^62 which can lead to incorrect results.

For example:

#include <wchar.h>
int
main(int argc, char ** argv) {
    assert(__wcsncmp_evex(L"abc", L"abd", (1UL << 62)) != 0);
    assert(__wcsncmp_avx2(L"abc", L"abd", (1UL << 62)) != 0);
}

Will fail on either assert.