diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2016-01-28 23:16:43 +0100 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2016-01-29 08:37:01 +0000 |
commit | 4588a2bd2f76fd064f7b9cc0d36f7fc2727f9445 (patch) | |
tree | 3b15557f20f53c8935215af88af78b09abfb618c /epan | |
parent | 6e53a0667832c9a67654f198ee5a1935c54b8b75 (diff) |
tds: don't THROW() an exception from a dissector
return the error to the caller, exit the loop and the dissection...
Change-Id: Iba64a5d5e4f79bc33c2b1c91b937c9726e15a802
Reviewed-on: https://code.wireshark.org/review/13587
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-tds.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c index 1ca4a6770d..0306ae7f56 100644 --- a/epan/dissectors/packet-tds.c +++ b/epan/dissectors/packet-tds.c @@ -347,6 +347,8 @@ #define TDS_DATA_TYPE_IMAGE 0x22 /* 34 = Image */ #define TDS_DATA_TYPE_NTEXT 0x63 /* 99 = NText */ #define TDS_DATA_TYPE_SSVARIANT 0x62 /* 98 = Sql_Variant (introduced in TDS 7.2) */ +/* no official data type, used only as error indication */ +#define TDS_DATA_TYPE_INVALID G_MAXUINT8 #define is_fixedlen_type_sybase(x) (x==SYBINT1 || \ x==SYBINT2 || \ @@ -3410,7 +3412,8 @@ dissect_tds_type_info(tvbuff_t *tvb, guint *offset, packet_info *pinfo, proto_tr break; default: expert_add_info(pinfo, data_type_item, &ei_tds_type_info_type); - THROW(ReportedBoundsError); /* No point in continuing */ + varlen_len = 0; + data_type = TDS_DATA_TYPE_INVALID; } if(varlen_len) @@ -3539,6 +3542,8 @@ dissect_tds_rpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(status_sub_tree, hf_tds_rpc_parameter_status_default, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; data_type = dissect_tds_type_info(tvb, &offset, pinfo, sub_tree, &plp, FALSE); + if (data_type == TDS_DATA_TYPE_INVALID) + break; dissect_tds_type_varbyte(tvb, &offset, pinfo, sub_tree, hf_tds_rpc_parameter_value, data_type, 0, plp, -1); /* TODO: Precision needs setting? */ proto_item_set_end(param_item, tvb, offset); } |