Skip to content
Snippets Groups Projects
Unverified Commit 2bc017ff authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #2255 from Eran-YT/fix-oob-read

Fix OOB read in raw.c
parents 82f3b753 79194d3c
No related branches found
No related tags found
No related merge requests found
......@@ -239,7 +239,7 @@ raw_read_segment(IMG_RAW_INFO * raw_info, int idx, char *buf,
// the number of bytes read
if (sector_aligned_buf != NULL) {
memcpy(buf, sector_aligned_buf + rel_offset % raw_info->img_info.sector_size, len);
cnt = cnt - offset_to_read % raw_info->img_info.sector_size;
cnt = cnt - rel_offset % raw_info->img_info.sector_size;
if (cnt < 0) {
cnt = -1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment