summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-h248.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2014-11-17 21:43:36 +0100
committerMichael Mann <mmann78@netscape.net>2014-11-17 21:21:10 +0000
commitf4ad915be4d5561fadfb239156405d838d4e08e1 (patch)
treec7f7683727f2a28f3fd6d667ba998f24ba80fe3b /epan/dissectors/packet-h248.c
parentda69b51c9e1c9e97860e8a48856acdd3ab381c07 (diff)
downloadwireshark-f4ad915be4d5561fadfb239156405d838d4e08e1.tar.gz
H248: Fix Dereference of null pointer found by Clang analyzer
Also fix some indent issue Change-Id: I262bdddd031fec6a0f91b7172bb2d67be3c33000 Reviewed-on: https://code.wireshark.org/review/5370 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-h248.c')
-rw-r--r--epan/dissectors/packet-h248.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c
index 30683b0dbb..14ae46eae1 100644
--- a/epan/dissectors/packet-h248.c
+++ b/epan/dissectors/packet-h248.c
@@ -1456,26 +1456,28 @@ void h248_register_package(h248_package_t* pkg, pkg_reg_action reg_action) {
}
pkg_found = s_pkg->pkg;
if (reg_action==MERGE_PKG_HIGH) {
- pkg_high = (h248_package_t *)pkg;
- pkg_low = pkg_found;
+ pkg_high = (h248_package_t *)pkg;
+ pkg_low = pkg_found;
};
if (reg_action==MERGE_PKG_LOW) {
- pkg_high = pkg_found;
- pkg_low = (h248_package_t *)pkg;
+ pkg_high = pkg_found;
+ pkg_low = (h248_package_t *)pkg;
};
- /* if h248_package_t High Priority value !NULL, replace it in the found tree entry else use current entry */
- (pkg_high->hfid ? (pkg_found->hfid=pkg_high->hfid) : (pkg_found->hfid=pkg_low->hfid));
- (pkg_high->ett ? (pkg_found->ett=pkg_high->ett ):( pkg_found->ett=pkg_low->ett));
- (pkg_high->param_names ? (pkg_found->param_names=pkg_high->param_names ):( pkg_found->param_names=pkg_low->param_names));
- (pkg_high->signal_names ? (pkg_found->signal_names=pkg_high->signal_names ):( pkg_found->signal_names=pkg_low->signal_names));
- (pkg_high->event_names ? (pkg_found->event_names=pkg_high->event_names ):( pkg_found->event_names=pkg_low->event_names));
- (pkg_high->stats_names ? (pkg_found->stats_names=pkg_high->stats_names ):( pkg_found->stats_names=pkg_low->stats_names));
- (pkg_high->properties ? (pkg_found->properties=pkg_high->properties ):( pkg_found->properties=pkg_low->properties));
- (pkg_high->signals ? (pkg_found->signals=pkg_high->signals ):( pkg_found->signals=pkg_low->signals));
- (pkg_high->events ? (pkg_found->events=pkg_high->events ):( pkg_found->events=pkg_low->events));
- (pkg_high->statistics ? (pkg_found->statistics=pkg_high->statistics ):( pkg_found->statistics=pkg_low->statistics));
- s_pkg->pkg = pkg_found;
- s_pkg->is_default = FALSE;
+ if(pkg_high) {
+ /* if h248_package_t High Priority value !NULL, replace it in the found tree entry else use current entry */
+ (pkg_high->hfid ? (pkg_found->hfid=pkg_high->hfid) : (pkg_found->hfid=pkg_low->hfid));
+ (pkg_high->ett ? (pkg_found->ett=pkg_high->ett ):( pkg_found->ett=pkg_low->ett));
+ (pkg_high->param_names ? (pkg_found->param_names=pkg_high->param_names ):( pkg_found->param_names=pkg_low->param_names));
+ (pkg_high->signal_names ? (pkg_found->signal_names=pkg_high->signal_names ):( pkg_found->signal_names=pkg_low->signal_names));
+ (pkg_high->event_names ? (pkg_found->event_names=pkg_high->event_names ):( pkg_found->event_names=pkg_low->event_names));
+ (pkg_high->stats_names ? (pkg_found->stats_names=pkg_high->stats_names ):( pkg_found->stats_names=pkg_low->stats_names));
+ (pkg_high->properties ? (pkg_found->properties=pkg_high->properties ):( pkg_found->properties=pkg_low->properties));
+ (pkg_high->signals ? (pkg_found->signals=pkg_high->signals ):( pkg_found->signals=pkg_low->signals));
+ (pkg_high->events ? (pkg_found->events=pkg_high->events ):( pkg_found->events=pkg_low->events));
+ (pkg_high->statistics ? (pkg_found->statistics=pkg_high->statistics ):( pkg_found->statistics=pkg_low->statistics));
+ s_pkg->pkg = pkg_found;
+ s_pkg->is_default = FALSE;
+ }
}
@@ -5384,7 +5386,7 @@ dissect_h248_ValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U
/*--- End of included file: packet-h248-fn.c ---*/
-#line 1415 "../../asn1/h248/packet-h248-template.c"
+#line 1417 "../../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);
@@ -6806,7 +6808,7 @@ void proto_register_h248(void) {
NULL, HFILL }},
/*--- End of included file: packet-h248-hfarr.c ---*/
-#line 1580 "../../asn1/h248/packet-h248-template.c"
+#line 1582 "../../asn1/h248/packet-h248-template.c"
GCP_HF_ARR_ELEMS("h248",h248_arrel)
@@ -6972,7 +6974,7 @@ void proto_register_h248(void) {
&ett_h248_SigParameterV1,
/*--- End of included file: packet-h248-ettarr.c ---*/
-#line 1598 "../../asn1/h248/packet-h248-template.c"
+#line 1600 "../../asn1/h248/packet-h248-template.c"
};
static ei_register_info ei[] = {