[PATCH 01/13] net: tftp: Increase TFTP pkt string length to include null character

Tom Rini trini at konsulko.com
Thu Jan 9 16:27:07 CET 2025


On Thu, Jan 09, 2025 at 12:41:56PM +0530, Vankar, Chintan wrote:
> 
> 
> On 1/7/2025 7:52 PM, Tom Rini wrote:
> > On Tue, Jan 07, 2025 at 03:08:28PM +0530, Chintan Vankar wrote:
> > 
> > > 'sprintf()' function defined in 'tiny-printf.c' is returning length of the
> > > string excluding null character. Fix this by increasing TFTP pkt length by
> > > 1 to avoid TFTP error of request being not-null terminated while
> > > requesting length of packet.
> > > 
> > > Signed-off-by: Chintan Vankar <c-vankar at ti.com>
> > 
> > Erm, if tiny-printf's sprintf doesn't work like lib/vsprintf.c's sprintf
> > in this regard, we should be fixing tiny-printf.
> > 
> 
> Hello Tom, I have observed that 'sprintf()' defined in lib/vsprintf.c
> at here:
> https://github.com/torvalds/linux/blob/master/lib/vsprintf.c#L3035
> also behaves the same way, that returns length of the string excluding
> null character.

Then please rework the commit message, thanks.

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


More information about the U-Boot mailing list