(bfd_get_section_contents): Since this function reads unrelocated contents, the
section's raw size is always the one to use for bounds checking.
This commit is contained in:
parent
f550cec5b1
commit
aaa486c3d0
@ -887,10 +887,10 @@ DEFUN(bfd_get_section_contents,(abfd, section, location, offset, count),
|
||||
bfd_error = bad_value;
|
||||
return false;
|
||||
}
|
||||
sz = bfd_get_section_size_now (abfd, section);
|
||||
if (offset > sz
|
||||
|| count > sz
|
||||
|| offset + count > sz)
|
||||
/* Even if reloc_done is true, this function reads unrelocated
|
||||
contents, so we want the raw size. */
|
||||
sz = section->_raw_size;
|
||||
if (offset > sz || count > sz || offset + count > sz)
|
||||
goto bad_val;
|
||||
|
||||
if (count == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user