The iter_notes method has code to parse NT_GNU_PROPERTY_TYPE_0 type notes. The contents of the note are interpreted as an array of elffile.structs.Elf_Props.
There was a bug where it would keep on parsing from the stream until the end of the segment or section. This is only correct if the note would be the last in the segment/section. In general, it should stop parsing until it reaches the end of the note's data buffer.
The
iter_notes
method has code to parseNT_GNU_PROPERTY_TYPE_0
type notes. The contents of the note are interpreted as an array ofelffile.structs.Elf_Prop
s.There was a bug where it would keep on parsing from the stream until the end of the segment or section. This is only correct if the note would be the last in the segment/section. In general, it should stop parsing until it reaches the end of the note's data buffer.
This PR fixes this bug.
Fixes: https://github.com/eliben/pyelftools/issues/534