Skip to content

Commit 769e9ad

Browse files
committed
Fix inconsistent payload-length check
1 parent 32b0358 commit 769e9ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,10 +729,10 @@ fn dlt_payload<T: NomByteOrder>(
729729
Err(e) => Err(e),
730730
}
731731
} else {
732-
if input.len() < 4 {
732+
if payload_length < 4 {
733733
return Err(nom::Err::Failure(DltParseError::ParsingHickup(format!(
734734
"error, payload too short {}",
735-
input.len()
735+
payload_length
736736
))));
737737
}
738738
match tuple((T::parse_u32, take(payload_length - 4)))(input) {

0 commit comments

Comments
 (0)