Skip to content

Commit d1f7efd

Browse files
committed
f - add comment about cursor check
1 parent 3b13853 commit d1f7efd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lightning/src/offers/parse.rs

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ impl<T: SeekReadable> TryFrom<Vec<u8>> for ParsedMessage<T> {
9090
let mut cursor = io::Cursor::new(bytes);
9191
let tlv_stream: T = SeekReadable::read(&mut cursor)?;
9292

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

0 commit comments

Comments
 (0)