From d5e1b41e429183fc4a3ec29926c85900018d5d0c Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Sat, 29 Nov 2008 21:21:54 +0000 Subject: [PATCH] The tvb can be of size 0. svn path=/trunk/; revision=26878 --- asn1/s1ap/s1ap.cnf | 6 ++++-- epan/dissectors/packet-s1ap.c | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/asn1/s1ap/s1ap.cnf b/asn1/s1ap/s1ap.cnf index 283ea422ab..ad74daeedf 100644 --- a/asn1/s1ap/s1ap.cnf +++ b/asn1/s1ap/s1ap.cnf @@ -163,8 +163,10 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound") offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 3, 3, FALSE, ¶meter_tvb); - - if (!parameter_tvb) + if(tvb_length(tvb)==0) + return offset; + + if (!parameter_tvb) return offset; dissect_e212_mcc_mnc(parameter_tvb, tree, 0); #.END diff --git a/epan/dissectors/packet-s1ap.c b/epan/dissectors/packet-s1ap.c index 1a2bc98f99..5b224a8e8d 100644 --- a/epan/dissectors/packet-s1ap.c +++ b/epan/dissectors/packet-s1ap.c @@ -1142,8 +1142,10 @@ dissect_s1ap_PLMNidentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 3, 3, FALSE, ¶meter_tvb); - - if (!parameter_tvb) + if(tvb_length(tvb)==0) + return offset; + + if (!parameter_tvb) return offset; dissect_e212_mcc_mnc(parameter_tvb, tree, 0); @@ -1669,7 +1671,7 @@ dissect_s1ap_ENB_UE_S1AP_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx static int dissect_s1ap_ENBname(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 173 "s1ap.cnf" +#line 175 "s1ap.cnf" tvbuff_t *parameter_tvb=NULL; int length; int p_offset; @@ -2088,7 +2090,7 @@ dissect_s1ap_M_TMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pro static int dissect_s1ap_NAS_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 199 "s1ap.cnf" +#line 201 "s1ap.cnf" tvbuff_t *parameter_tvb=NULL;