Skip to content

utils.cpp:324 - Out-of-bounds write: merkle_root[65] overflow 65-byte buffer #771

@jesterhodl

Description

@jesterhodl

Hi, I think there is a 1-byte buffer overflow at src/utils.cpp:324. The array merkle_root is declared with size 65 (valid indices are 0 to 64), but the code writes:

merkle_root[65] = 0;

which accesses index 65 and writes where it shouldn't and possibly corrupts some other variable.

Because it seems to attempt to null-terminate after a for loop which correctly uses snprintf(), this line is best removed, because it's well null-terminated anyway.

I also see, not much work is being done on the project, happy to do a PR or take other advice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions