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

Chintan Vankar c-vankar at ti.com
Thu Mar 20 08:26:16 CET 2025


Hello Wadim,

On 20/03/25 12:44, Wadim Egorov wrote:
> Am 09.01.25 um 23:27 schrieb Tom Rini:
>> 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>
> 
> Tested-by: Wadim Egorov <w.egorov at phytec.de>
> 

Thank you for testing the patch.

>>>>
>>>> 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.
> 
> Any updates on this patch?
> 
> I can see the exact same error when using ethernet boot on phycore-am62x:
> 

The fixed for this issue is there in "tiny-printf.c" file itself and fix
for the same is posted by Alexander at:
https://lore.kernel.org/r/20250220124908.3396843-1-alexander.sverdlin@siemens.com/


Regards,
Chintan.

> Filename 'phyboard-lyra-am62xx-3/tispl.bin'.
> Load address: 0x82000000
> Loading: *
> TFTP error: 'Request not null-terminated' (4)
> 


More information about the U-Boot mailing list