Skip to content
Commit bbf3c7ff authored by Justin Stitt's avatar Justin Stitt Committed by Kees Cook
Browse files

lib/string_helpers: rework overflow-dependent code



When @size is 0, the desired behavior is to allow unlimited bytes to be
parsed. Currently, this relies on some intentional arithmetic overflow
where --size gives us SIZE_MAX when size is 0.

Explicitly spell out the desired behavior without relying on intentional
overflow/underflow.

Signed-off-by: default avatarJustin Stitt <justinstitt@google.com>
Link: https://lore.kernel.org/r/20240808-b4-string_helpers_caa133-v1-1-686a455167c4@google.com


Signed-off-by: default avatarKees Cook <kees@kernel.org>
parent 0336f898
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment