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

[1.x] Fix MemIOCallback buffer overflows #149

Merged
merged 2 commits into from
Nov 4, 2023

Conversation

robUx4
Copy link
Contributor

@robUx4 robUx4 commented Nov 4, 2023

Same as #148 for the 1.x branch.

If the addition of 2 positive values is smaller than one of the values then we
have an overflowing addition.

In this case that means we are trying to read more data that is actually in
our buffer. So we can use the same mechanism as reading too much data.

(cherry picked from commit 4d577f5)
Signed-off-by: Steve Lhomme <slhomme@matroska.org>
If the addition of 2 positive values is smaller than one of the values then we
have an overflowing addition.

In this case we will not be able to allocate that much, just return a size
written as 0.

(cherry picked from commit 2d5c11c)
Signed-off-by: Steve Lhomme <slhomme@matroska.org>
@robUx4 robUx4 added the bug label Nov 4, 2023
@robUx4 robUx4 merged commit f3249a7 into Matroska-Org:v1.x Nov 4, 2023
6 checks passed
@robUx4 robUx4 deleted the 1x_overflow branch November 11, 2023 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants