Commit 02874ca5 authored by Leo Yan's avatar Leo Yan Committed by Greg Kroah-Hartman
Browse files

tracing: Consider the NULL character when validating the event length

[ Upstream commit 0b6e2e22 ]

strlen() returns a string length excluding the null byte. If the string
length equals to the maximum buffer length, the buffer will have no
space for the NULL terminating character.

This commit checks this condition and returns failure for it.

Link: https://lore.kernel.org/all/20241007144724.920954-1-leo.yan@arm.com/



Fixes: dec65d79 ("tracing/probe: Check event name length correctly")
Signed-off-by: default avatarLeo Yan <leo.yan@arm.com>
Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent df848523
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment