cryptonote_basic: log invalid hash input size
What changed, and why it matters
This commit changes a single error log message. Instead of printing the full invalid hash string, it now prints only the length of that string. This is a minor logging improvement and does not change any program behavior, security boundary, or data flow.
No security action required. Treat as routine code hygiene.
Security signals we found
No security-relevant behavior change
Logging-only change
No input parsing or validation logic modified
Evidence from the diff
The patch modifies parse_hash256() in src/cryptonote_basic/cryptonote_basic_impl.cpp. The function already rejected invalid hex strings and wrong-size buffers before the change. The only difference is the content of the MERROR log line: it now logs str_hash.size() rather than the raw str_hash. No validation logic, return values, or control flow were altered.
Changed components
src/cryptonote_basic/cryptonote_basic_impl.cppInspect captured patch +1 / −1
diff --git a/src/cryptonote_basic/cryptonote_basic_impl.cpp b/src/cryptonote_basic/cryptonote_basic_impl.cpp
index fd4a642..c9bf7dc 100644
--- a/src/cryptonote_basic/cryptonote_basic_impl.cpp
+++ b/src/cryptonote_basic/cryptonote_basic_impl.cpp
@@ -310,7 +310,7 @@ bool parse_hash256(const std::string &str_hash, crypto::hash& hash)
bool res = epee::string_tools::parse_hexstr_to_binbuff(str_hash, buf);
if (!res || buf.size() != sizeof(crypto::hash))
{
- MERROR("invalid hash format: " << str_hash);
+ MERROR("invalid hash format, input size: " << str_hash.size());
return false;
}
else
Why this scored 14/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.