What changed, and why it matters
This commit is a minor code fix to make the project compile ('fix build'). It only changes how an error value is constructed—adding a descriptive message string to an existing error type. The underlying security behavior (rejecting transaction hashes that are not exactly 32 bytes) is unchanged. There is no indication this fixes a security vulnerability.
No security action needed. Treat as a normal build fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff updates two call sites in rust/rust_c/src/stellar/mod.rs where RustCError::InvalidData was used without an argument. The error type apparently now requires a String message, so the commit supplies ‘Invalid transaction hash length’.to_string(). The validation logic (sign_data.len() != 32) and the early return on invalid input remain identical. This is purely a build/API-compatibility fix.
Changed components
rust/rust_c/src/stellar/mod.rsInspect captured patch +8 / −2
diff --git a/rust/rust_c/src/stellar/mod.rs b/rust/rust_c/src/stellar/mod.rs
index 7c7d629..898b603 100644
--- a/rust/rust_c/src/stellar/mod.rs
+++ b/rust/rust_c/src/stellar/mod.rs
@@ -44,7 +44,10 @@ pub unsafe extern "C" fn stellar_parse(
SignType::TransactionHash => {
let sign_data = sign_request.get_sign_data();
if sign_data.len() != 32 {
- return TransactionParseResult::from(RustCError::InvalidData).c_ptr();
+ return TransactionParseResult::from(RustCError::InvalidData(
+ "Invalid transaction hash length".to_string(),
+ ))
+ .c_ptr();
}
hex::encode(sign_data)
}
@@ -125,7 +128,10 @@ pub unsafe extern "C" fn stellar_sign(
},
SignType::TransactionHash => {
if sign_data.len() != 32 {
- return UREncodeResult::from(RustCError::InvalidData).c_ptr();
+ return UREncodeResult::from(RustCError::InvalidData(
+ "Invalid transaction hash length".to_string(),
+ ))
+ .c_ptr();
}
match sign_hash(&sign_data, seed, &path) {
Ok(signature) => build_signature_data(&signature, sign_request.to_owned()),
Why this scored 15/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.