summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-h248.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-06-07 18:03:25 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2015-06-07 18:59:49 +0000
commit093aebf5eeab624471a659cf8643a6a07e2b58e6 (patch)
tree6de87aebdcad0c853e256ee071f8ed58e3b75006 /epan/dissectors/packet-h248.c
parentd48fe0d2e4b680c9a2ed6b4f2aa91370449a6e8b (diff)
downloadwireshark-093aebf5eeab624471a659cf8643a6a07e2b58e6.tar.gz
H248: fix V712 warning reported by PVS-Studio
Be advised that compiler may delete this cycle or make it infinity. Use volatile variable(s) or synchronization primitives to avoid this. Change-Id: I39104ec09f4c12994d62ed23e7a0cc00829b1255 Reviewed-on: https://code.wireshark.org/review/8818 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-h248.c')
-rw-r--r--epan/dissectors/packet-h248.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c
index a65f56666e..4bda7dbc7f 100644
--- a/epan/dissectors/packet-h248.c
+++ b/epan/dissectors/packet-h248.c
@@ -1417,10 +1417,11 @@ void h248_register_package(h248_package_t* pkg, pkg_reg_action reg_action) {
if (!try_val_to_str_idx((pkg_found->id)<<16, base_signal_name_vals, &j)) {
j++; idx=j;
while((base_signal_name_vals[j].strptr != NULL) && ((base_signal_name_vals[j].value>>16) == (pkg_found->id))) {
+ j++;
};
if (idx < j) {
- vst = g_new0(value_string,j-idx+1);
- for (k=0;idx<i;k++) {
+ vst = (value_string *)wmem_alloc0(wmem_epan_scope(), sizeof(value_string)*(j-idx+1));
+ for (k=0;idx<j;k++) {
vst[k].strptr = base_signal_name_vals[idx].strptr;
vst[k].value = (base_signal_name_vals[idx].value &0xffff);
idx++;
@@ -5339,7 +5340,7 @@ dissect_h248_SigParameterV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
/*--- End of included file: packet-h248-fn.c ---*/
-#line 1417 "../../asn1/h248/packet-h248-template.c"
+#line 1418 "../../asn1/h248/packet-h248-template.c"
static void dissect_h248_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
dissect_tpkt_encap(tvb, pinfo, tree, h248_desegment, h248_handle);
@@ -6761,7 +6762,7 @@ void proto_register_h248(void) {
NULL, HFILL }},
/*--- End of included file: packet-h248-hfarr.c ---*/
-#line 1582 "../../asn1/h248/packet-h248-template.c"
+#line 1583 "../../asn1/h248/packet-h248-template.c"
GCP_HF_ARR_ELEMS("h248",h248_arrel)
@@ -6927,7 +6928,7 @@ void proto_register_h248(void) {
&ett_h248_SigParameterV1,
/*--- End of included file: packet-h248-ettarr.c ---*/
-#line 1600 "../../asn1/h248/packet-h248-template.c"
+#line 1601 "../../asn1/h248/packet-h248-template.c"
};
static ei_register_info ei[] = {