You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Validate codes vector size in BlockInvertedLists deserialization (#4920)
Summary:
Pull Request resolved: #4920
After READVECTOR reads ids[i] and codes[i] in BlockInvertedListsIOHook::read(),
validate that codes[i].size() matches the expected value computed from
ids[i].size(), n_per_block, and block_size. Uses mul_no_overflow to detect
integer overflow in the n_block * block_size computation, preventing
crafted inputs from bypassing the size check via wraparound.
Without this check, a maliciously crafted serialized BlockInvertedLists could
have inconsistent codes and ids vectors, leading to out-of-bounds memory
access during search or add operations.
Reviewed By: mnorris11
Differential Revision: D96346307
fbshipit-source-id: 43156fa287fa004cc9d178fc558d168b7b3848dc
0 commit comments