[PATCH] common: cli_hush: fix console_buffer overflow on boot retry

Tom Rini trini at konsulko.com
Tue Apr 14 04:09:32 CEST 2026


On Mon, Apr 06, 2026 at 09:30:27AM +0700, Ngo Luong Thanh Tra wrote:

> Add const_strcpy() macro to linux/build_bug.h that enforces at
> compile time that the destination is a writable char array (not char *
> or const char *), the source is a string literal, and the source fits
> in the destination including the NUL terminator.
> 
> Fix the console_buffer extern declaration in console.h to include the
> array size so sizeof(console_buffer) is valid at call sites.
> 
> Replace unbounded strcpy() in cli_hush.c with const_strcpy().
> 
> Fixes: 657e19f8f2dd ("cli_hush: support running bootcmd on boot retry")
> 
> Changes in v3:
> - Reject const char * destinations in const_strcpy() (Simon Glass)
> 
> Signed-off-by: Ngo Luong Thanh Tra <S4210155 at student.rmit.edu.au>

Can you please rebase on top of current master?

> Made-with: Cursor

Please see
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-assistants.rst
and rework this tag as well, thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260413/72017b35/attachment.sig>


More information about the U-Boot mailing list