🐞 fix(l2tp偏移长度计算时,增加长度判断):

This commit is contained in:
yangwei
2023-07-23 20:45:16 +08:00
parent 320851f683
commit 0c02227c58

View File

@@ -389,6 +389,10 @@ static int __mjl_parse_l2tpv2_hdr(const struct l2tp_hdr_v2 *pl2tphdrv2, struct l
if(pl2tphdrv2->offset_present){
offset_size = ntohs(*((unsigned short *)ptr));
if(offset_size > 1460)
{
return -1;
}
ptr += sizeof(short); /* 2 byte fix len offset size */
ptr += offset_size; /* var bytes offset value length */
}