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

Truncate the mask when its length is greater than the length of the internal value #344

Conversation

nada-ben-ali
Copy link
Collaborator

@nada-ben-ali nada-ben-ali commented Sep 18, 2024

This change is to avoid the “OverflowError: int too big to convert” exception when the length of the mask exceeds the length of the internal value. The issue arises when self.bit_mask contains more bits than can be represented by the given number of bytes (sz), leading to an overflow during the conversion to bytes.

By ensuring that the mask is truncated or adjusted to fit within the appropriate byte size, this approach prevents the exception and allows for safe conversion of the mask, and then prevents unexpected crashes due to overflow.

image

odxtools version: 8.0.5

@kayoub5 kayoub5 requested a review from andlaus September 18, 2024 16:07
@andlaus
Copy link
Collaborator

andlaus commented Sep 19, 2024

thanks!

@andlaus andlaus merged commit ba81e22 into mercedes-benz:main Sep 19, 2024
7 checks passed
@andlaus
Copy link
Collaborator

andlaus commented Sep 19, 2024

@nada-ben-ali: I've added you to the maintainers of the repository. Welcome to the club :)

@nada-ben-ali
Copy link
Collaborator Author

@andlaus Thank you a lot 🤩

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.

3 participants