Linux Hardening
 help / color / mirror / Atom feed
* [PATCH] string: Add missing const
@ 2026-11-25 18:26 Alejandro Colomar
  2026-11-26 15:20 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Alejandro Colomar @ 2026-11-25 18:26 UTC (permalink / raw)
  To: Kees Cook, linux-hardening; +Cc: Alejandro Colomar, Andy Shevchenko

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

This pointer is derived from other const pointers.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
---

Hi,

This was found while changing some <linux/string.h> APIs to preserve the
const qualifier in the return type.


Have a lovely night!
Alex

 lib/tests/string_kunit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tests/string_kunit.c b/lib/tests/string_kunit.c
index f84a60d4414c..2b681089c200 100644
--- a/lib/tests/string_kunit.c
+++ b/lib/tests/string_kunit.c
@@ -233,7 +233,7 @@ static void string_test_strnchr(struct kunit *test)
 {
 	const char *test_string = "abcdefghijkl";
 	const char *empty_string = "";
-	char *result;
+	const char *result;
 	int i, j;
 
 	for (i = 0; i < strlen(test_string) + 1; i++) {
-- 
2.55.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-26 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 18:26 [PATCH] string: Add missing const Alejandro Colomar
2026-11-26 15:20 ` Andy Shevchenko
2026-11-26 15:55   ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox