summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2025-02-06 15:24:37 -0800
committerKees Cook <kees@kernel.org>2025-02-28 11:51:32 -0800
commitae4c0935f63c76674c3e64097e059e2f20e051b6 (patch)
tree2aaefc9e21e29019f2d3a37e55793b09d0cc0281
parent88a157a3204d08067cffd93cb990d86cb6d75cc6 (diff)
string: kunit: Mark nonstring test strings as __nonstring
In preparation for strtomem*() checking that its destination is a __nonstring, annotate "nonstring" and "nonstring_small" variables accordingly. Signed-off-by: Kees Cook <kees@kernel.org>
-rw-r--r--lib/string_kunit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/string_kunit.c b/lib/string_kunit.c
index c919e3293da6..0ed7448a26d3 100644
--- a/lib/string_kunit.c
+++ b/lib/string_kunit.c
@@ -579,8 +579,8 @@ static void string_test_strtomem(struct kunit *test)
static void string_test_memtostr(struct kunit *test)
{
- char nonstring[7] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g' };
- char nonstring_small[3] = { 'a', 'b', 'c' };
+ char nonstring[7] __nonstring = { 'a', 'b', 'c', 'd', 'e', 'f', 'g' };
+ char nonstring_small[3] __nonstring = { 'a', 'b', 'c' };
char dest[sizeof(nonstring) + 1];
/* Copy in a non-NUL-terminated string into exactly right-sized dest. */