Skip to content
Commit 63c84a82 authored by Noah Goldstein's avatar Noah Goldstein Committed by H.J. Lu
Browse files

String: Add overflow tests for strnlen, memchr, and strncat [BZ #27974]



This commit adds tests for a bug in the wide char variant of the
functions where the implementation may assume that maxlen for wcsnlen
or n for wmemchr/strncat will not overflow when multiplied by
sizeof(wchar_t).

These tests show the following implementations failing on x86_64:

wcsnlen-sse4_1
wcsnlen-avx2

wmemchr-sse2
wmemchr-avx2

strncat would fail as well if it where on a system that prefered
either of the wcsnlen implementations that failed as it relies on
wcsnlen.

Signed-off-by: default avatarNoah Goldstein <goldstein.w.n@gmail.com>
Reviewed-by: default avatarH.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit da5a6fba)
parent 7dbd7af6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment