From 4588a2bd2f76fd064f7b9cc0d36f7fc2727f9445 Mon Sep 17 00:00:00 2001 From: Martin Kaiser Date: Thu, 28 Jan 2016 23:16:43 +0100 Subject: 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 --- epan/dissectors/packet-tds.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'epan/dissectors/packet-tds.c') 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); } -- cgit v1.2.1