Correct a potential buffer overrun in verify_range()
This moves the "chunksize" calculation that occurs when comparing
buffers to the beginning of the loop so it reflects the actual
number of bytes remaining after i is incremented. Rookie error.
This may have gone unnoticed for a long time since chunksize usually
divides the total length evenly, so the value of chunksize remained
the same for each iteration.
BUG=none
BRANCH=none
TEST=verify_read() no longer corrupts the read buffer on a wierdly
sized chunk.
Change-Id: I9b37fd237c94f7198c4ba0ce13171c8594f5dd09
Reviewed-on: https://chromium-review.googlesource.com/213232
Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>
1 file changed