Prevent possible (benign ?) array references with an array index of -1.
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 6 Aug 2009 18:44:38 +0000 (18:44 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 6 Aug 2009 18:44:38 +0000 (18:44 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29312 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-gsm_a_rr.c

index a46bcb0260b508b3a50798a54d9bf42282f86d90..ef2de9b48b1b5abb98da12df8bca167b6181ad55 100644 (file)
@@ -8398,9 +8398,11 @@ void get_rr_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf
     gint                       idx;
 
     *msg_str = match_strval_idx((guint32) (oct & DTAP_RR_IEI_MASK), gsm_a_dtap_msg_rr_strings, &idx);
-    *ett_tree = ett_gsm_dtap_msg_rr[idx];
     *hf_idx = hf_gsm_a_dtap_msg_rr_type;
-    *msg_fcn = dtap_msg_rr_fcn[idx];
+    if (*msg_str != NULL) {
+        *ett_tree = ett_gsm_dtap_msg_rr[idx];
+        *msg_fcn  = dtap_msg_rr_fcn[idx];
+    }
 
     return;
 }
@@ -8656,9 +8658,11 @@ void get_rr_short_pd_msg_params(guint8 mess_type, const gchar **msg_str, int *et
     gint                       idx;
 
     *msg_str = match_strval_idx((guint32) mess_type, gsm_a_sacch_msg_rr_strings, &idx);
-    *ett_tree = ett_gsm_sacch_msg_rr[idx];
     *hf_idx = hf_gsm_a_sacch_msg_rr_type;
-    *msg_fcn = sacch_msg_rr_fcn[idx];
+    if (*msg_str != NULL) {
+        *ett_tree = ett_gsm_sacch_msg_rr[idx];
+        *msg_fcn = sacch_msg_rr_fcn[idx];
+    }
 }
 
 const value_string short_protocol_discriminator_vals[] = {