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 buffer over-reads #1753

Merged
merged 5 commits into from
Nov 2, 2021
Merged

Conversation

kaetemi
Copy link
Contributor

@kaetemi kaetemi commented Nov 2, 2021

Description

Fixes buffer overruns.

Testing instructions

Run the testing suite using a debug build with out of bounds checks enabled.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Copy link
Contributor

@hewigovens hewigovens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the fix, how did you find it, compiler warning?

@kaetemi
Copy link
Contributor Author

kaetemi commented Nov 2, 2021

Debug asserts are thrown on these cases when running in Debug mode compiled under Visual Studio.

Didn't find anything significant in the compiler warnings so far. (Mostly just implicit type casts and const correctness.)

@optout21
Copy link
Contributor

optout21 commented Nov 2, 2021

I have reworked a bit the RLP checks. In some cases the check was there a few lines above. I have extended the error messages (to be more informative).
While at it, I chenged to use existing subData() method in a few more cases, and also created a version of it optimized for tail-substring.

@optout21 optout21 merged commit 7b1ede3 into trustwallet:master Nov 2, 2021
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.

None yet

3 participants