zcash_address: Assert that the unified encoding is exactly consumed

This commit is contained in:
str4d 2021-09-02 23:24:23 +01:00 committed by GitHub
parent ce6ac7aee6
commit eca002dae0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -268,6 +268,7 @@ impl TryFrom<(&str, &[u8])> for Address {
while cursor.position() < encoded.len().try_into().unwrap() {
result.push(read_receiver(&mut cursor)?);
}
assert_eq!(cursor.position(), encoded.len().try_into().unwrap());
result.try_into()
}
}