Fix errors in the packet length checks.

svn path=/trunk/; revision=44939
This commit is contained in:
Anders Broman 2012-09-17 12:13:34 +00:00
parent 9db969ded1
commit 8e74cd8d16
1 changed files with 5 additions and 2 deletions

View File

@ -2479,7 +2479,7 @@ dissect_ip_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return FALSE;
}
tot_length = tvb_get_ntohs(tvb,4);
if(tot_length != 40 + (int)tvb_reported_length(tvb)){
if((tot_length + 40) != (int)tvb_reported_length(tvb)){
return FALSE;
}
call_dissector(ipv6_handle, tvb, pinfo, tree);
@ -2489,9 +2489,12 @@ dissect_ip_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if((version != 4)|| (ihl < 5)){
return FALSE;
}
/* Total Length is the length of the datagram, measured in octets,
* including internet header and data.
*/
tot_length = tvb_get_ntohs(tvb,2);
if(tot_length != 8 + (int)tvb_reported_length(tvb)){
if(tot_length != (int)tvb_reported_length(tvb)){
return FALSE;
}