mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 04:52:23 +00:00
LibELF: Prevent negative index when determining dynamic symbol count
This commit is contained in:
parent
a90e876667
commit
c87e1084b6
Notes:
sideshowbarker
2024-07-17 03:30:41 +09:00
Author: https://github.com/Ollrogge
Commit: c87e1084b6
Pull-request: https://github.com/SerenityOS/serenity/pull/23587
Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 5 additions and 0 deletions
|
@ -242,6 +242,11 @@ void DynamicObject::parse()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (highest_chain_idx < num_omitted_symbols) {
|
||||||
|
m_symbol_count = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
size_t amount_symbols = highest_chain_idx;
|
size_t amount_symbols = highest_chain_idx;
|
||||||
u32 const* last_chain = &chains[highest_chain_idx - num_omitted_symbols];
|
u32 const* last_chain = &chains[highest_chain_idx - num_omitted_symbols];
|
||||||
while ((*(last_chain++) & 1) == 0) {
|
while ((*(last_chain++) & 1) == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue