]> git.ipfire.org Git - thirdparty/glibc.git/commit
x86: Fix overflow bug in wcsnlen-sse4_1 and wcsnlen-avx2 [BZ #27974]
authorNoah Goldstein <goldstein.w.n@gmail.com>
Wed, 23 Jun 2021 05:56:29 +0000 (01:56 -0400)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 27 Jan 2022 22:09:24 +0000 (14:09 -0800)
commitcef3bffade9a4b73ea73336df416d62b63ea4540
treefafda6654384f14373a9c866a67b10460a688b32
parent3ac5a7fe8b9fb5ce0ed9c35a5f44f4e8ceffeb0d
x86: Fix overflow bug in wcsnlen-sse4_1 and wcsnlen-avx2 [BZ #27974]

This commit fixes the bug mentioned in the previous commit.

The previous implementations of wmemchr in these files relied
on maxlen * sizeof(wchar_t) which was not guranteed by the standard.

The new overflow tests added in the previous commit now
pass (As well as all the other tests).

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit a775a7a3eb1e85b54af0b4ee5ff4dcf66772a1fb)
sysdeps/x86_64/multiarch/strlen-avx2.S
sysdeps/x86_64/multiarch/strlen-vec.S