diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-09-24 13:01:49 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-09-24 20:02:20 +0000 |
commit | 7517b73e74bd3a425406e08fa0ce667a655ee049 (patch) | |
tree | c224c0999c035ce50b98363da5e373b7dbb3ec0c /epan | |
parent | a9963c45e79440094df221dfcb34b11ba94f0882 (diff) |
Replace DISSECTOR_ASSERT(hfinfo->type == FT_STRING) with DISSECTOR_ASSERT_FIELD_TYPE.
That produces better error messages, giving the name of the offending
field.
Change-Id: I155ac29c68ecd7811cc9752980db9cdc37fea72e
Reviewed-on: https://code.wireshark.org/review/23685
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-dcerpc.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-rpc.c | 2 | ||||
-rw-r--r-- | epan/proto.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c index a3f700d527..4d715dae99 100644 --- a/epan/dissectors/packet-dcerpc.c +++ b/epan/dissectors/packet-dcerpc.c @@ -2599,7 +2599,7 @@ dissect_ndr_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo, /* Make sure this really is a string field. */ hfinfo = proto_registrar_get_nth(hfindex); - DISSECTOR_ASSERT(hfinfo->type == FT_STRING); + DISSECTOR_ASSERT_FIELD_TYPE(hfinfo, FT_STRING); if (di->conformant_run) { /* just a run to handle conformant arrays, no scalars to dissect */ @@ -2784,7 +2784,7 @@ dissect_ndr_vstring(tvbuff_t *tvb, int offset, packet_info *pinfo, /* Make sure this really is a string field. */ hfinfo = proto_registrar_get_nth(hfindex); - DISSECTOR_ASSERT(hfinfo->type == FT_STRING); + DISSECTOR_ASSERT_FIELD_TYPE(hfinfo, FT_STRING); if (di->conformant_run) { /* just a run to handle conformant arrays, no scalars to dissect */ diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index f00c88296a..1bb86a1267 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -684,7 +684,7 @@ dissect_rpc_uint64(tvbuff_t *tvb, proto_tree *tree, header_field_info *hfinfo; hfinfo = proto_registrar_get_nth(hfindex); - DISSECTOR_ASSERT(hfinfo->type == FT_UINT64); + DISSECTOR_ASSERT_FIELD_TYPE(hfinfo, FT_UINT64); proto_tree_add_item(tree, hfindex, tvb, offset, 8, ENC_BIG_ENDIAN); return offset + 8; diff --git a/epan/proto.c b/epan/proto.c index 1935bc5d6a..c785733a1d 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -11140,7 +11140,7 @@ proto_tree_add_boolean_bits_format_value64(proto_tree *tree, const int hfindex, TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field); - DISSECTOR_ASSERT(hf_field->type == FT_BOOLEAN); + DISSECTOR_ASSERT_FIELD_TYPE(hf_field, FT_BOOLEAN); CREATE_VALUE_STRING(dst, format, ap); |