Re: [PATCH 1/7] xyz-modem: Fix crash after cancelling transfer

2021-09-03 Thread Tom Rini
On Tue, Aug 03, 2021 at 04:28:38PM +0200, Pali Rohár wrote: > Variable xyz.len is set to -1 on error. At the end xyzModem_stream_read() > function calls memcpy() with length from variable xyz.len. If this variable > is set to -1 then value passed to memcpy is casted to unsigned value, which >

Re: [PATCH 1/7] xyz-modem: Fix crash after cancelling transfer

2021-08-04 Thread Heinrich Schuchardt
On 03.08.21 16:28, Pali Rohár wrote: Variable xyz.len is set to -1 on error. At the end xyzModem_stream_read() function calls memcpy() with length from variable xyz.len. If this variable is set to -1 then value passed to memcpy is casted to unsigned value, which means to copy whole address

[PATCH 1/7] xyz-modem: Fix crash after cancelling transfer

2021-08-03 Thread Pali Rohár
Variable xyz.len is set to -1 on error. At the end xyzModem_stream_read() function calls memcpy() with length from variable xyz.len. If this variable is set to -1 then value passed to memcpy is casted to unsigned value, which means to copy whole address space. Which then cause U-Boot crash. E.g.