Skip to content

Commit b9fcc37

Browse files
committed
f - add comment about cursor check
1 parent 8570fd9 commit b9fcc37

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lightning/src/offers/parse.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ impl<T: SeekReadable> TryFrom<Vec<u8>> for ParsedMessage<T> {
6868
let mut cursor = io::Cursor::new(bytes);
6969
let tlv_stream: T = SeekReadable::read(&mut cursor)?;
7070

71+
// Ensure that there are no more TLV records left to parse.
7172
if cursor.position() < cursor.get_ref().len() as u64 {
7273
return Err(DecodeError::InvalidValue);
7374
}

0 commit comments

Comments
 (0)