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

Add memory boundary guard for RLE decoding #12

Merged
merged 5 commits into from
Sep 17, 2022

Conversation

maxclaey
Copy link
Contributor

The current implementation of rleDecode does not check memory boundaries, causing unrecoverable segmentation faults for invalid RLE representations. This MR adds this check and will raise a catchable ValueError in this scenario rather than segfaulting.

@ppwwyyxx
Copy link
Owner

ppwwyyxx commented Sep 1, 2022

Could you add a minimal test case in https://github.com/ppwwyyxx/cocoapi/blob/master/tests/test_cases.py? So that I know what error it's trying to fix

@maxclaey
Copy link
Contributor Author

maxclaey commented Sep 1, 2022

Sure, I added a testcase!

@maxclaey
Copy link
Contributor Author

@ppwwyyxx Does this testcase meet your request?

@ppwwyyxx
Copy link
Owner

Thanks a lot for fixing this!

@ppwwyyxx ppwwyyxx closed this Sep 17, 2022
@ppwwyyxx ppwwyyxx reopened this Sep 17, 2022
@ppwwyyxx ppwwyyxx merged commit 602c960 into ppwwyyxx:master Sep 17, 2022
@ppwwyyxx
Copy link
Owner

Included in the latest version 2.0.5 on pypi: https://pypi.org/project/pycocotools/

@maxclaey
Copy link
Contributor Author

Welcome, thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants