Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+2 -2
+2 -2
lib/string_kunit.c
··· 579 579 580 580 static void string_test_memtostr(struct kunit *test) 581 581 { 582 - char nonstring[7] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g' }; 583 - char nonstring_small[3] = { 'a', 'b', 'c' }; 582 + char nonstring[7] __nonstring = { 'a', 'b', 'c', 'd', 'e', 'f', 'g' }; 583 + char nonstring_small[3] __nonstring = { 'a', 'b', 'c' }; 584 584 char dest[sizeof(nonstring) + 1]; 585 585 586 586 /* Copy in a non-NUL-terminated string into exactly right-sized dest. */