linux-yocto/tools/net
David Wei 511ea82e34 tools: ynl-gen: validate 0 len strings from kernel
[ Upstream commit 4720f9707c ]

Strings from the kernel are guaranteed to be null terminated and
ynl_attr_validate() checks for this. But it doesn't check if the string
has a len of 0, which would cause problems when trying to access
data[len - 1]. Fix this by checking that len is positive.

Signed-off-by: David Wei <dw@davidwei.uk>
Link: https://patch.msgid.link/20250503043050.861238-1-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-05-29 11:03:12 +02:00
..
sunrpc/xdrgen xdrgen: Prevent reordering of encoder and decoder functions 2024-09-20 19:31:41 -04:00
ynl tools: ynl-gen: validate 0 len strings from kernel 2025-05-29 11:03:12 +02:00