Skip to content

Add allocation size overflow checks in ZDICT_trainBuffer_legacy()#4616

Open
nidu-ninja wants to merge 1 commit intofacebook:devfrom
nidu-ninja:fix/zdict-allocation-overflow-checks
Open

Add allocation size overflow checks in ZDICT_trainBuffer_legacy()#4616
nidu-ninja wants to merge 1 commit intofacebook:devfrom
nidu-ninja:fix/zdict-allocation-overflow-checks

Conversation

@nidu-ninja
Copy link
Contributor

PR adds overflow checks to several memory allocations in
ZDICT_trainBuffer_legacy() within zdict.c.

The function previously computed allocation sizes using expressions such as:

(bufferSize + N) * sizeof(type)
nbFiles * sizeof(type)

without validating whether the intermediate arithmetic could overflow size_t.

@meta-cla meta-cla bot added the CLA Signed label Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant