[PATCH v2] xilinx: versal: Fix snprintf invalid size argument

Michal Simek michal.simek at amd.com
Thu Jul 2 16:40:49 CEST 2026



On 7/2/26 15:54, Francois Berder wrote:
> buf is an array of size DFU_ALT_BUF_LEN bytes.
> It is gradually filled with data using snprintf but the
> size argument to snprintf is kept at DFU_ALT_BUF_LEN,
> making it possible to overflow the buffer.
> Fix this bug using the correct buffer size:
> DFU_ALT_BUF_LEN - len.
> Also, replace snprintf by scnprintf, otherwise len
> variable is incremented incorrectly. It is now
> incremented by the actual character count written
> in buf.
>      
> v2: Replace snprintf by scnprintf

this should be below --- not to be the part of commit message.

M


More information about the U-Boot mailing list