Files
linux/lib
Josh Law 1120a36bb1 lib/bootconfig: fix snprintf truncation check in xbc_node_compose_key_after()
snprintf() returns the number of characters that would have been
written excluding the NUL terminator.  Output is truncated when the
return value is >= the buffer size, not just > the buffer size.

When ret == size, the current code takes the non-truncated path,
advancing buf by ret and reducing size to 0.  This is wrong because
the output was actually truncated (the last character was replaced by
NUL).  Fix by using >= so the truncation path is taken correctly.

Link: https://lore.kernel.org/all/20260312191143.28719-4-objecting@objecting.org/

Fixes: 76db5a27a8 ("bootconfig: Add Extra Boot Config support")
Cc: stable@vger.kernel.org
Signed-off-by: Josh Law <objecting@objecting.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
2026-03-13 17:48:27 +09:00
..
2025-03-16 22:30:49 -07:00
2025-04-11 17:32:37 -07:00
2025-01-12 20:21:15 -08:00
2026-01-26 19:07:13 -08:00
2025-10-24 21:39:27 +02:00
2024-10-14 16:33:24 -05:00
2026-01-11 06:09:11 -10:00
2025-11-27 14:24:30 -08:00
2024-02-15 12:17:28 -05:00
2025-03-25 10:18:31 -03:00
2024-12-09 13:48:29 -08:00
2025-09-13 16:54:46 -07:00