fortify: Do not cast to "unsigned char"
authorKees Cook <keescook@chromium.org>
Tue, 25 Oct 2022 23:05:18 +0000 (16:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:31 +0000 (13:32 +0100)
commited88147bfb4e7cd009cb33c7395a45d52f296bcc
tree1297d54cd665dac0ff226a6122cd9b723bcda997
parent12695b4b76d437b9c0182a6f7dfb2248013a9daf
fortify: Do not cast to "unsigned char"

[ Upstream commit e9a40e1585d792751d3a122392695e5a53032809 ]

Do not cast to "unsigned char", as this needlessly creates type problems
when attempting builds without -Wno-pointer-sign[1]. The intent of the
cast is to drop possible "const" types.

[1] https://lore.kernel.org/lkml/CAHk-=wgz3Uba8w7kdXhsqR1qvfemYL+OFQdefJnkeqXG8qZ_pA@mail.gmail.com/

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Fixes: 3009f891bb9f ("fortify: Allow strlen() and strnlen() to pass compile-time known lengths")
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/fortify-string.h