diff options
-rw-r--r-- | epan/dissectors/packet-l2tp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c index 8e785decff..aeb5c64cd0 100644 --- a/epan/dissectors/packet-l2tp.c +++ b/epan/dissectors/packet-l2tp.c @@ -806,9 +806,13 @@ static int check_control_digest(l2tpv3_tunnel_t *tunnel, switch (tvb_get_guint8(tvb, idx)) { case L2TP_HMAC_MD5: + if ((avp_len - 1) != L2TP_HMAC_MD5_DIGEST_LEN) + return -1; md5_hmac_digest(tunnel, tvb, length, idx, avp_len, msg_type, pinfo, digest); break; case L2TP_HMAC_SHA1: + if ((avp_len - 1) != L2TP_HMAC_SHA1_DIGEST_LEN) + return -1; sha1_hmac_digest(tunnel, tvb, length, idx, avp_len, msg_type, pinfo, digest); break; default: |