Blame wireshark-0017-Fix-https-bugs.wireshark.org-bugzilla-show_bug.cgi-i.patch

61af30
From: Pascal Quantin <pascal.quantin@gmail.com>
61af30
Date: Fri, 6 Dec 2013 07:14:45 +0000
61af30
Subject: [PATCH] Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9488
61af30
 : Remove global gpinfo variable and use pinfo directly (backport of r49145)
61af30
61af30
svn path=/trunk-1.10/; revision=53803
61af30
61af30
diff --git a/epan/dissectors/packet-bssgp.c b/epan/dissectors/packet-bssgp.c
61af30
index a89e970..0421cae 100644
61af30
--- a/epan/dissectors/packet-bssgp.c
61af30
+++ b/epan/dissectors/packet-bssgp.c
61af30
@@ -79,7 +79,6 @@ void proto_reg_handoff_bssgp(void);
61af30
 static int bssgp_decode_nri = 0;
61af30
 static guint bssgp_nri_length = 4;
61af30
 
61af30
-static packet_info *gpinfo;
61af30
 static guint8 g_pdu_type, g_rim_application_identity;
61af30
 static proto_tree *gparent_tree;
61af30
 static dissector_handle_t llc_handle;
61af30
@@ -898,7 +897,7 @@ de_bssgp_flush_action(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, g
61af30
  */
61af30
 
61af30
 static guint16
61af30
-de_bssgp_llc_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_llc_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     tvbuff_t *next_tvb=NULL;
61af30
     guint32 curr_offset;
61af30
@@ -912,10 +911,10 @@ de_bssgp_llc_pdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint3
61af30
 
61af30
     if(next_tvb){
61af30
         if (llc_handle) {
61af30
-            call_dissector(llc_handle, next_tvb, gpinfo, gparent_tree);
61af30
+            call_dissector(llc_handle, next_tvb, pinfo, gparent_tree);
61af30
         }
61af30
         else if (data_handle) {
61af30
-            call_dissector(data_handle, next_tvb, gpinfo, gparent_tree);
61af30
+            call_dissector(data_handle, next_tvb, pinfo, gparent_tree);
61af30
         }
61af30
     }
61af30
 
61af30
@@ -1100,7 +1099,7 @@ static const value_string bssgp_precedence_dl[] = {
61af30
 };
61af30
 
61af30
 static guint16
61af30
-de_bssgp_qos_profile(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_qos_profile(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     proto_item *pi, *pre_item;
61af30
     guint32 curr_offset;
61af30
@@ -1113,7 +1112,7 @@ de_bssgp_qos_profile(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, gu
61af30
     /* octet 3-4 Peak bit rate provided by the network (note)
61af30
      * NOTE: The bit rate 0 (zero) shall mean "best effort" in this IE.
61af30
      */
61af30
-    link_dir = gpinfo->link_dir;
61af30
+    link_dir = pinfo->link_dir;
61af30
 
61af30
     peak_bit_rate = tvb_get_ntohs(tvb, curr_offset);
61af30
     pi = proto_tree_add_text(tree, tvb, curr_offset, 1, "Peak bit rate: ");
61af30
@@ -1515,7 +1514,7 @@ de_bssgp_serv_utran_cco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
61af30
  * 11.3.48  NSEI (Network Service Entity Identifier)
61af30
  */
61af30
 static guint16
61af30
-de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     guint32 curr_offset;
61af30
     guint16 nsei;
61af30
@@ -1526,7 +1525,7 @@ de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 o
61af30
     proto_tree_add_item(tree, hf_bssgp_nsei, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
61af30
     curr_offset+=2;
61af30
 
61af30
-    col_append_sep_fstr(gpinfo->cinfo, COL_INFO, BSSGP_SEP, "NSEI %u", nsei);
61af30
+    col_append_sep_fstr(pinfo->cinfo, COL_INFO, BSSGP_SEP, "NSEI %u", nsei);
61af30
 
61af30
 
61af30
     return(curr_offset-offset);
61af30
@@ -1535,7 +1534,7 @@ de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 o
61af30
  * 11.3.49  RRLP APDU
61af30
  */
61af30
 static guint16
61af30
-de_bssgp_rrlp_apdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_rrlp_apdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     tvbuff_t *next_tvb=NULL;
61af30
     guint32 curr_offset;
61af30
@@ -1555,9 +1554,9 @@ de_bssgp_rrlp_apdu(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guin
61af30
 
61af30
     if(next_tvb){
61af30
         if (rrlp_handle) {
61af30
-            call_dissector(rrlp_handle, next_tvb, gpinfo, gparent_tree);
61af30
+            call_dissector(rrlp_handle, next_tvb, pinfo, gparent_tree);
61af30
         }else if (data_handle) {
61af30
-            call_dissector(data_handle, next_tvb, gpinfo, gparent_tree);
61af30
+            call_dissector(data_handle, next_tvb, pinfo, gparent_tree);
61af30
         }
61af30
     }
61af30
     return(len);
61af30
@@ -1748,7 +1747,7 @@ de_bssgp_ran_information_request_app_cont(tvbuff_t *tvb, proto_tree *tree, packe
61af30
             {
61af30
             asn1_ctx_t asn1_ctx;
61af30
 
61af30
-            asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, gpinfo);
61af30
+            asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
61af30
             /* 11.3.63.1.4  RAN-INFORMATION-REQUEST Application Container for the SON Transfer Application */
61af30
             /* Reporting Cell Identifier */
61af30
             /* convert to bit offset */
61af30
@@ -1765,7 +1764,7 @@ de_bssgp_ran_information_request_app_cont(tvbuff_t *tvb, proto_tree *tree, packe
61af30
              * 3GPP TS 25.413
61af30
              */
61af30
             new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
61af30
-            curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, gpinfo, tree, NULL);
61af30
+            curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, pinfo, tree, NULL);
61af30
             break;
61af30
         default :
61af30
             proto_tree_add_text(tree, tvb, curr_offset, len, "Unknown RIM Application Identity");
61af30
@@ -1847,7 +1846,7 @@ de_bssgp_ran_information_app_cont_unit(tvbuff_t *tvb, proto_tree *tree, packet_i
61af30
                     if (msg_fcn_p == NULL){
61af30
                         proto_tree_add_text(si_tree, tvb, curr_offset, 21, "Unknown SI message");
61af30
                     }else{
61af30
-                        (*msg_fcn_p)(tvb, si_tree, gpinfo, curr_offset+1, 20);
61af30
+                        (*msg_fcn_p)(tvb, si_tree, pinfo, curr_offset+1, 20);
61af30
                     }
61af30
                     curr_offset+=21;
61af30
                 }
61af30
@@ -1895,14 +1894,14 @@ de_bssgp_ran_information_app_cont_unit(tvbuff_t *tvb, proto_tree *tree, packet_i
61af30
                      * Source Cell ID) as defined in 3GPP TS 25.413
61af30
                      */
61af30
                     new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
61af30
-                    curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, gpinfo, tree, NULL);
61af30
+                    curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, pinfo, tree, NULL);
61af30
                     break;
61af30
                 case 2:
61af30
                     /* If the RAT discriminator field indicates E-UTRAN, this field is encoded as the E-UTRAN CGI IE as
61af30
                      * defined in 3GPP TS 36.413
61af30
                      */
61af30
                     new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
61af30
-                    curr_offset = curr_offset + dissect_s1ap_Global_ENB_ID_PDU(new_tvb, gpinfo, tree, NULL);
61af30
+                    curr_offset = curr_offset + dissect_s1ap_Global_ENB_ID_PDU(new_tvb, pinfo, tree, NULL);
61af30
                     break;
61af30
                 default:
61af30
                     break;
61af30
@@ -1916,7 +1915,7 @@ de_bssgp_ran_information_app_cont_unit(tvbuff_t *tvb, proto_tree *tree, packet_i
61af30
              * (UTRAN Source Cell ID) as defined in 3GPP TS 25.413
61af30
              */
61af30
             new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
61af30
-            curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, gpinfo, tree, NULL);
61af30
+            curr_offset = curr_offset + dissect_ranap_SourceCellID_PDU(new_tvb, pinfo, tree, NULL);
61af30
             /* Octet (m+1)-n UTRA SI Container
61af30
              * UTRA SI Container: This field contains System Information Container valid for the reporting cell
61af30
              * encoded as defined in TS 25.331
61af30
@@ -1972,7 +1971,7 @@ static const value_string bssgp_utra_si_cause_vals[] = {
61af30
 };
61af30
 
61af30
 static guint16
61af30
-de_bssgp_ran_app_error_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_ran_app_error_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     tvbuff_t *new_tvb = NULL;
61af30
     guint32 curr_offset;
61af30
@@ -2018,7 +2017,7 @@ de_bssgp_ran_app_error_cont(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo
61af30
              * The "SON Transfer Cause" field is encoded as the SON Transfer Cause IE as defined in 3GPP TS 36.413
61af30
              */
61af30
             new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
61af30
-            curr_offset = curr_offset + dissect_s1ap_SONtransferCause_PDU(new_tvb, gpinfo, tree, NULL);
61af30
+            curr_offset = curr_offset + dissect_s1ap_SONtransferCause_PDU(new_tvb, pinfo, tree, NULL);
61af30
             /* Erroneous Application Container including IEI and LI */
61af30
             proto_tree_add_text(tree, tvb, curr_offset, len-(curr_offset-offset), "Erroneous Application Container including IEI and LI");
61af30
             break;
61af30
@@ -2212,7 +2211,7 @@ static const value_string bssgp_ra_discriminator_vals[] = {
61af30
 };
61af30
 
61af30
 static guint16
61af30
-de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     guint8 oct;
61af30
     guint16 rnc_id;
61af30
@@ -2261,7 +2260,7 @@ de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_
61af30
             curr_offset = curr_offset+ de_emm_trac_area_id(tvb, tree, pinfo, curr_offset, 5, add_string, string_len);
61af30
             /* Octets 9-n contain the Global eNB ID (see 3GPP TS 36.413 [36]) of the eNodeB. */
61af30
             new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
61af30
-            dissect_s1ap_Global_ENB_ID_PDU(new_tvb, gpinfo, tree, NULL);
61af30
+            dissect_s1ap_Global_ENB_ID_PDU(new_tvb, pinfo, tree, NULL);
61af30
             break;
61af30
         default:
61af30
             proto_tree_add_text(tree, tvb, curr_offset, 3, "Unknown RIM Routing Address discriminator");
61af30
@@ -2301,7 +2300,7 @@ de_bssgp_mbms_session_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_
61af30
  * 11.3.72  MBMS Session Duration
61af30
  */
61af30
 static guint16
61af30
-de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     tvbuff_t *new_tvb;
61af30
     guint32 curr_offset;
61af30
@@ -2310,7 +2309,7 @@ de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U
61af30
 
61af30
     /* AVP Code: 904 MBMS-Session-Duration Registered by packet-gtp.c */
61af30
     new_tvb =tvb_new_subset(tvb, offset, len, len);
61af30
-    dissector_try_uint(diameter_3gpp_avp_dissector_table, 904, new_tvb, gpinfo, tree);
61af30
+    dissector_try_uint(diameter_3gpp_avp_dissector_table, 904, new_tvb, pinfo, tree);
61af30
 
61af30
     return(curr_offset-offset);
61af30
 }
61af30
@@ -2322,7 +2321,7 @@ de_bssgp_mbms_session_dur(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U
61af30
  *
61af30
  */
61af30
 static guint16
61af30
-de_bssgp_mbms_sai_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_mbms_sai_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     tvbuff_t *new_tvb;
61af30
     guint32 curr_offset;
61af30
@@ -2331,7 +2330,7 @@ de_bssgp_mbms_sai_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
61af30
 
61af30
     /* AVP Code: 903 MBMS-Service-Area Registered by packet-gtp.c */
61af30
     new_tvb =tvb_new_subset(tvb, offset, len, len);
61af30
-    dissector_try_uint(diameter_3gpp_avp_dissector_table, 903, new_tvb, gpinfo, tree);
61af30
+    dissector_try_uint(diameter_3gpp_avp_dissector_table, 903, new_tvb, pinfo, tree);
61af30
 
61af30
     return(curr_offset-offset);
61af30
 }
61af30
@@ -2840,7 +2839,7 @@ de_bssgp_mbms_session_rep_no(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo
61af30
  * 11.3.94  Inter RAT Handover Info
61af30
  */
61af30
 static guint16
61af30
-de_bssgp_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     tvbuff_t    *new_tvb;
61af30
     guint32 curr_offset;
61af30
@@ -2852,7 +2851,7 @@ de_bssgp_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _
61af30
      * Inter RAT Handover Information coded as specified in 3GPP
61af30
      * Technical Specification 25.331
61af30
      */
61af30
-    dissect_rrc_InterRATHandoverInfo_PDU(new_tvb, gpinfo, tree, NULL);
61af30
+    dissect_rrc_InterRATHandoverInfo_PDU(new_tvb, pinfo, tree, NULL);
61af30
 
61af30
     return(len);
61af30
 }
61af30
@@ -3096,7 +3095,7 @@ de_bssgp_enb_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off
61af30
 
61af30
     /* Octets 8-n contain the Global eNB ID (see 3GPP TS 36.413) of the eNodeB. */
61af30
     new_tvb = tvb_new_subset_remaining(tvb, curr_offset);
61af30
-    dissect_s1ap_Global_ENB_ID_PDU(new_tvb, gpinfo, tree, NULL);
61af30
+    dissect_s1ap_Global_ENB_ID_PDU(new_tvb, pinfo, tree, NULL);
61af30
 
61af30
     return(len);
61af30
 }
61af30
@@ -3104,7 +3103,7 @@ de_bssgp_enb_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off
61af30
  * 11.3.104     E-UTRAN Inter RAT Handover Info
61af30
  */
61af30
 static guint16
61af30
-de_bssgp_e_utran_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_e_utran_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     tvbuff_t    *new_tvb;
61af30
     guint32 curr_offset;
61af30
@@ -3118,7 +3117,7 @@ de_bssgp_e_utran_inter_rat_ho_info(tvbuff_t *tvb, proto_tree *tree, packet_info
61af30
      * significant bit of the first octet of the octet string contains bit 8 of
61af30
      * the first octet of the IE.
61af30
      */
61af30
-    dissect_lte_rrc_UE_EUTRA_Capability_PDU(new_tvb, gpinfo, tree, NULL);
61af30
+    dissect_lte_rrc_UE_EUTRA_Capability_PDU(new_tvb, pinfo, tree, NULL);
61af30
 
61af30
     return(len);
61af30
 }
61af30
@@ -3181,7 +3180,7 @@ de_bssgp_reliable_inter_rat_ho_inf(tvbuff_t *tvb, proto_tree *tree, packet_info
61af30
  * 11.3.108     SON Transfer Application Identity
61af30
  */
61af30
 static guint16
61af30
-de_bssgp_son_transfer_app_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset _U_, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
+de_bssgp_son_transfer_app_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset _U_, guint len _U_, gchar *add_string _U_, int string_len _U_)
61af30
 {
61af30
     tvbuff_t *next_tvb;
61af30
 
61af30
@@ -3190,7 +3189,7 @@ de_bssgp_son_transfer_app_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo
61af30
      */
61af30
     if(len > 0){
61af30
         next_tvb = tvb_new_subset(tvb, offset, len, len);
61af30
-        dissect_s1ap_SONtransferApplicationIdentity_PDU(next_tvb, gpinfo, tree, NULL);
61af30
+        dissect_s1ap_SONtransferApplicationIdentity_PDU(next_tvb, pinfo, tree, NULL);
61af30
     }
61af30
 
61af30
     return(len);
61af30
@@ -6370,8 +6369,6 @@ dissect_bssgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
61af30
     int          hf_idx;
61af30
     void        (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len);
61af30
 
61af30
-    /* Save pinfo */
61af30
-    gpinfo = pinfo;
61af30
     g_rim_application_identity = 0;
61af30
     gparent_tree = tree;
61af30
     len = tvb_length(tvb);