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

Set proper size in hex2bin call #471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mutatrum
Copy link
Contributor

Fixes #302

It actually doesn't corrupt memory, as hex2bin stops on null termination of the string provided by cJSON. But it's still better to have the correct len value passed to hex2bin.

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

Good catch.
Reviewed the change and ran a quick local test feeding hex2bin a 32-byte C string containing a hash, with bin_len set to HASH_SIZE. Printed each byte written to bin and saw the correct hash. Did not build deploy esp-miner to a bitaxe with this change.

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.

Possible Memory Corruption
2 participants