The patch fixes the analysis of the input data which contains an off
by one.
The issue is visible when the SGL contains one byte per SG entry.
The code for checking for zero bytes does not operate on the data byte.
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
const u8 *buff = sg_virt(sg);
int len = sg->length;
- while (len-- && !*buff++)
+ while (len && !*buff) {
lzeros++;
+ len--;
+ buff++;
+ }
if (len && *buff)
break;