Skip to content

Commit

Permalink
netbsd-tests: libc: fix strvis(3) overflow tests
Browse files Browse the repository at this point in the history
These tests weren't run on x86 until CI grabbed them.  It turns out,
there's a sign extension bug that surfaces on x86 with char being a
signed type.

NetBSD unearthed this when they took and improved the patch, so just
grab their solution until we get to merging in the latest version of
the test.

Reported by:	CI (via ngie)
Fixes:	2f489a5 ("libc: fix some overflow scenarios in vis(3)")
  • Loading branch information
kevans91 committed Aug 20, 2023
1 parent 9a7add6 commit 79e6ffb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/netbsd-tests/lib/libc/gen/t_vis.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ ATF_TC_BODY(strvis_locale, tc)
#endif /* VIS_NOLOCALE */

#ifdef __FreeBSD__
#define STRVIS_OVERFLOW_MARKER 0xff /* Arbitrary */
#define STRVIS_OVERFLOW_MARKER ((char)0xff) /* Arbitrary */

ATF_TC(strvis_overflow_mb);
ATF_TC_HEAD(strvis_overflow_mb, tc)
Expand Down

0 comments on commit 79e6ffb

Please sign in to comment.