Repository navigation
fix: fail on missing Address Library ids - #15
Merged
shad0wshayd3 merged 1 commit intoOct 29, 2026
Merged
Conversation
For formats below 5, lower_bound returned the next-higher id's offset when the id was missing, so the call silently went to an unrelated address. For format 5, an id past the end of the table was read out of bounds. Both now fail with the existing 'Failed to find offset' message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IDDB::offsetcould return a wrong address instead of failing when an id is not in the loaded Address Library.Why
std::lower_boundlands on the next-higher id when the requested id is missing, and onlyend()counted as a failure, so the caller got that neighbour's offset and jumped into an unrelated function.m_v5[a_id]was read without a bounds check, so an id past the end of the table read outside the mapped data.A plugin that uses an id its runtime does not have then crashes somewhere far from the cause instead of stopping with the usual message. CommonLibSSE-NG already does this exact-match check (
it == end() || it->id != a_id).Changes
it->id != a_id.m_v5.size()are treated like a zero entry.Both cases now report the existing "Failed to find offset for Address Library ID!" message with the plugin name, id and game version.
Offset2ID::get_id(offset to id) has the same nearest-match behaviour; it is left alone here.Testing
commonlib-sharedbuilds (x64-windows-static-md)