mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
The current code has a problematic corner case with formar "%c" and 0 as parameter. The proper zero byte is being emitted into digit buffer but the final copy into outstr expects null-terminated string and doesn't copy the required \0 byte. This has lead to malformed TFTP packets, refer to tftp_send() which relies on %c to generate multiple zero-terminated strings in one buffer. Introduce a variable to force the copy of one character in this case. The new behaviour is consistent with non-tiny implementation. Reported-by: Chintan Vankar <c-vankar@ti.com> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
7.9 KiB
7.9 KiB