forked from osmocom/wireshark
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>
This commit is contained in:
parent
da69b51c9e
commit
f4ad915be4
|
@ -981,26 +981,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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[] = {
|
||||
|
|
Loading…
Reference in New Issue