Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Limit memory allocation by MAX_CRYPTO_DATA_SIZE #2766

fix: better overflow protection.

1304f20
Select commit
Loading
Failed to load commit list.
Closed

fix: Limit memory allocation by MAX_CRYPTO_DATA_SIZE #2766

fix: better overflow protection.
1304f20
Select commit
Loading
Failed to load commit list.
Mergeable / Mergeable succeeded Sep 16, 2024 in 1s

3 checks passed!

Status: PASS

Details

✔️ Validator: TITLE

  • ✔️ All the requisite validations passed for 'or' option
    Input : fix: Limit memory allocation by MAX_CRYPTO_DATA_SIZE
    Settings : {"or":[{"must_include":{"regex":"^(feat|docs|chore|cleanup|fix|refactor|test|style|perf)(\\(\\w+\\))?:\\ .+$","message":"Semantic release conventions must be followed."}},{"must_include":{"regex":"^Bump [^ ]* from [^ ]* to [^ ]*$","message":"Dependabot PRs are exempt from semantic release conventions."}}]}

✔️ Validator: COMMIT

  • ✔️ Your commit messages met the specified criteria
    Input : fix: Limit memory allocation by MAX_CRYPTO_DATA_SIZE,fix: Remove size check as we do not know it,fix: better overflow protection.
    Settings : {"do":"commit","message":{"regex":"^((feat|docs|chore|cleanup|fix|refactor|test|style|perf)(\\(\\w+\\))?:\\ .+|Bump [^ ]* from [^ ]* to [^ ]*)","message":"Semantic release conventions must be followed."}}

✔️ Validator: DESCRIPTION

  • ✔️ description must exclude '\[ \]'
    Input : This PR is intended to fix the issue, when shiny object is shown to the camera during the call. In this scenario camera creates big frames, for which toxcore tries to allocate memory and if the frame is big enough, it may fail, resulting in overflow error.

In this fix we limit the allocation size to MAX_CRYPTO_DATA_SIZE and, limit the frame size to UINT16_MAX (we use length_safe instead of length variable).

I have tested the fix on qTox client.

See issue


This change is Reviewable

Settings : {"must_exclude":{"regex":"\\\\[ \\\\]","message":"There are incomplete TODO task(s) unchecked."}}