diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-11-17 21:43:36 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-11-17 21:21:10 +0000 |
commit | f4ad915be4d5561fadfb239156405d838d4e08e1 (patch) | |
tree | c7f7683727f2a28f3fd6d667ba998f24ba80fe3b /asn1 | |
parent | da69b51c9e1c9e97860e8a48856acdd3ab381c07 (diff) |
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 'asn1')
-rw-r--r-- | asn1/h248/packet-h248-template.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/asn1/h248/packet-h248-template.c b/asn1/h248/packet-h248-template.c index c2c18d516e..326575ca8e 100644 --- a/asn1/h248/packet-h248-template.c +++ b/asn1/h248/packet-h248-template.c @@ -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; + } } |