Re: [U-Boot] [PATCH] fs: ext4: Prevent erasing buffer past file size

2018-07-23 Thread Marek Vasut
On 07/23/2018 04:09 PM, Tom Rini wrote: > On Mon, Jul 23, 2018 at 11:42:12AM +0200, Marek Vasut wrote: > >> The variable 'n' represents the number of bytes to be read from a certain >> offset in a file, to a certain offset in buffer 'buf'. The variable 'len' >> represents the length of the entire

Re: [U-Boot] [PATCH] fs: ext4: Prevent erasing buffer past file size

2018-07-23 Thread Tom Rini
On Mon, Jul 23, 2018 at 11:42:12AM +0200, Marek Vasut wrote: > The variable 'n' represents the number of bytes to be read from a certain > offset in a file, to a certain offset in buffer 'buf'. The variable 'len' > represents the length of the entire file, clamped correctly to avoid any > overflow

Re: [U-Boot] [PATCH] fs: ext4: Prevent erasing buffer past file size

2018-07-23 Thread Stefano Babic
Hi Marek, On 23/07/2018 11:42, Marek Vasut wrote: > The variable 'n' represents the number of bytes to be read from a certain > offset in a file, to a certain offset in buffer 'buf'. The variable 'len' > represents the length of the entire file, clamped correctly to avoid any > overflows. > > The

[U-Boot] [PATCH] fs: ext4: Prevent erasing buffer past file size

2018-07-23 Thread Marek Vasut
The variable 'n' represents the number of bytes to be read from a certain offset in a file, to a certain offset in buffer 'buf'. The variable 'len' represents the length of the entire file, clamped correctly to avoid any overflows. Therefore, comparing 'n' and 'len' to determine whether clearing '