mip: properly advance offset if !tree

The offset must be advanced or else dissection of the following
extensions will result in a malformed packet exception.

Bug: 14292
Change-Id: I8b5cb2f377c8d3e01677b76f5bb6c3126dea64f9
Reviewed-on: https://code.wireshark.org/review/24970
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Peter Wu 2017-12-24 02:04:44 +01:00 committed by Anders Broman
parent 59688d3ec6
commit b1a2bef8bd
1 changed files with 13 additions and 6 deletions

View File

@ -899,7 +899,9 @@ dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
proto_tree_add_item(mip_tree, hf_mip_ident, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN);
offset += 8;
} /* if tree */
} else {
offset += 24;
}
break;
case MIP_REGISTRATION_REPLY:
col_add_fstr(pinfo->cinfo, COL_INFO,
@ -936,7 +938,9 @@ dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* Identifier - assumed to be an NTP time here */
proto_tree_add_item(mip_tree, hf_mip_ident, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN);
offset += 8;
} /* if tree */
} else {
offset += 20;
}
break;
case MIP_NATT_TUNNEL_DATA:
col_add_fstr(pinfo->cinfo, COL_INFO, "Tunnel Data: Next Header=%u",
@ -958,8 +962,7 @@ dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* reserved */
proto_tree_add_item(mip_tree, hf_mip_nattt_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
} /* if tree */
else {
} else {
offset += 4;
}
/* encapsulated payload */
@ -1012,7 +1015,9 @@ dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* revocation identifier */
proto_tree_add_item(mip_tree, hf_mip_revid, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
} /* if tree */
} else {
offset += 20;
}
break;
case MIP_REGISTRATION_REVOCATION_ACK:
col_add_fstr(pinfo->cinfo, COL_INFO, "Reg Revocation Ack: HoA=%s",
@ -1047,7 +1052,9 @@ dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* revocation identifier */
proto_tree_add_item(mip_tree, hf_mip_revid, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
} /* if tree */
} else {
offset += 12;
}
break;
} /* End switch */