map_merkle_path_add: ignore duplicates as per the other _add functions
What changed, and why it matters
This commit changes a single function call argument so that adding a duplicate merkle path to a map is ignored rather than rejected with an error. The change aligns this function with other similar 'add' functions in the same file. It is best understood as a consistency/robustness fix, but the commit message does not frame it as a security fix and no exploit path is demonstrated.
Treat as a low-risk consistency fix. Review callers of wally_map_merkle_path_add to confirm that duplicate-ignoring behavior is acceptable and does not mask unexpected state in higher-level protocols. No urgent security action is indicated based on the available evidence.
Security signals we found
Behavioral change from duplicate-rejection to duplicate-ignoring in a cryptographic map structure
Consistency fix with other _add functions in the same module
No bounds-checking, memory, or cryptographic validation changes
No vendor disclosure of security relevance
No CVE, advisory, or researcher attribution in commit or supplied references
Evidence from the diff
In src/map.c, wally_map_merkle_path_add now passes true for the ignore_duplicates parameter of map_add instead of false. This means if the same public key already exists in the map, the duplicate entry is silently ignored instead of returning WALLY_EINVAL. The change makes behavior consistent with wally_map_add, wally_map_add_integer, wally_map_keypath_add, and wally_map_tapleaf_add, which already pass true. No other logic changes.
Changed components
src/map.cwally_map_merkle_path_addInspect captured patch +1 / −1
diff --git a/src/map.c b/src/map.c
index 79703b1..d496c79 100644
--- a/src/map.c
+++ b/src/map.c
@@ -727,7 +727,7 @@ int wally_map_merkle_path_add(struct wally_map *map_in,
/* Add map for tap leaves */
return map_add(map_in, pub_key, pub_key_len,
- merkle_hashes, merkle_hashes_len, false, false);
+ merkle_hashes, merkle_hashes_len, false, true);
}
int wally_keypath_get_fingerprint(const unsigned char *val, size_t val_len,
Why this scored 32/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.