diff options
Diffstat (limited to 'src/protocol/l2tp.rs')
| -rw-r--r-- | src/protocol/l2tp.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/protocol/l2tp.rs b/src/protocol/l2tp.rs index fdf2b69..0496f2b 100644 --- a/src/protocol/l2tp.rs +++ b/src/protocol/l2tp.rs @@ -303,6 +303,9 @@ fn avp_decode(input: &[u8]) -> IResult<&[u8], AvpHeader> { * data in a single AVP. The minimum Length of an AVP is 6. If the * length is 6, then the Attribute Value field is absent. */ + if length < 6 { + return Err(nom::Err::Incomplete(nom::Needed::new((6 - length).into()))); + } let (input, attribute_value) = bytes::streaming::take(length - 6)(input)?; Ok(( |
