Open vapier opened 9 months ago
The second assert is unnecessary - parse_cstring_from_stream
will not read past the end of the stream (this ain't C, people). If there is indeed an unterminated string at the end of the section, parse_cstring_from_stream
will return None
and the expression in the assert
will throw an exception that you are calling len()
on a None
object.
Remove the second check, it's pointless and wrong.
@vapier Are you still interested in this change?
Some ELF files have strings pointing to an offset outside the string table dimension, let's throw an exception in that case.
Bug-Url: https://crbug.com/788925 Reviewed-on: https://chromium-review.googlesource.com/792553