aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ppp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2009-08-09 01:23:09 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2009-08-09 01:23:09 +0000
commit761b3cce77c05a4c2073749490bd0d1aed1d6e5f (patch)
tree1a01a83d827491c41593768815436d771012fed1 /epan/dissectors/packet-ppp.c
parent36f74ee8c8122dc6f51d8080ccf7b223ef47cce4 (diff)
Don't use DISSECTOR_ASSERT() to check a packet's content. Fixes bug
3827. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29339 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ppp.c')
-rw-r--r--epan/dissectors/packet-ppp.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index 76a704d108..7c7420cf2f 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -3275,8 +3275,6 @@ dissect_iphc_crtp_fh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ip_version = tvb_get_guint8(tvb, 0) >> 4;
next_protocol = tvb_get_guint8(tvb, 9);
- DISSECTOR_ASSERT((ip_version == 4) && (next_protocol == IP_PROTO_UDP));
-
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_iphc_crtp, tvb, 0, -1,
@@ -3285,17 +3283,31 @@ dissect_iphc_crtp_fh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
flags = (tvb_get_guint8(tvb, 2) & IPHC_CRTP_FH_FLAG_MASK) >> IPHC_CRTP_FH_FLAG_POS;
+ /* flags field */
+ ti = proto_tree_add_item(fh_tree, hf_iphc_crtp_fh_flags, tvb, 2, 1, FALSE);
+
+ /* generation field */
+ ti = proto_tree_add_item(fh_tree, hf_iphc_crtp_gen, tvb, 2, 1, FALSE);
+
/* calculate length of IP header, assume IPv4 */
ip_hdr_len = (tvb_get_guint8(tvb, 0) & 0x0f) * 4;
/* calculate total hdr length, assume UDP */
hdr_len = ip_hdr_len + 8;
- /* flags field */
- ti = proto_tree_add_item(fh_tree, hf_iphc_crtp_fh_flags, tvb, 2, 1, FALSE);
+ if (ip_version != 4) {
+ proto_tree_add_text(fh_tree, tvb, 3, -1,
+ "IP version is %u: the only supported version is 4",
+ ip_version);
+ return;
+ }
- /* generation field */
- ti = proto_tree_add_item(fh_tree, hf_iphc_crtp_gen, tvb, 2, 1, FALSE);
+ if (next_protocol != IP_PROTO_UDP) {
+ proto_tree_add_text(fh_tree, tvb, 3, -1,
+ "Next protocol is %s (%u): the only supported protocol is UDP",
+ ipprotostr(next_protocol), next_protocol);
+ return;
+ }
/* context id and sequence fields */
switch (flags) {