Commit e4162f51 authored by Etienne Pierre-doray's avatar Etienne Pierre-doray Committed by Commit Bot

[Clank SSM]: Fix check in ReadElfBuildId.

The comparison was too strict.
In practise, there's only one PT_NOTE segment, so early exit doesn't affect
behavior. For correctness, we should keep looking for other segment.

Change-Id: I49fb7ab3c7361d4ed6ea1d6f3a0c56db24dc13cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948497
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721182}
parent 01d41ff4
...@@ -111,7 +111,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base, ...@@ -111,7 +111,7 @@ size_t ReadElfBuildId(const void* elf_mapped_base,
size_t section_size = bits::Align(current_note->n_namesz, 4) + size_t section_size = bits::Align(current_note->n_namesz, 4) +
bits::Align(current_note->n_descsz, 4) + bits::Align(current_note->n_descsz, 4) +
sizeof(Nhdr); sizeof(Nhdr);
if (section_size >= static_cast<size_t>(section_end - current_section)) if (section_size > static_cast<size_t>(section_end - current_section))
return 0; return 0;
current_section += section_size; current_section += section_size;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment