aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-02-27 14:08:35 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2018-03-12 07:17:01 +0000
commit6e75a0b2774401fb184fc92db779aa6defab10aa (patch)
tree2efe745ec3e393811e0f060685e8b1cdc28c0b2d
parentba179a7ef7e660d788cbaade65982ffc7249b91f (diff)
ber/per: assert actx to avoid null dereference (found by clang).
Change-Id: I4efc6d30060bf8842d5facdd3151385b805fe22b Reviewed-on: https://code.wireshark.org/review/26136 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r--epan/dissectors/packet-ber.c2
-rw-r--r--epan/dissectors/packet-per.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 43d54fc098..9fb27749bb 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -4170,6 +4170,8 @@ static const ber_choice_t T_encoding_choice[] = {
static int
dissect_ber_T_encoding(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index) {
+ // This assertion is used to remove clang's warning.
+ DISSECTOR_ASSERT(actx);
offset = dissect_ber_choice(actx, tree, tvb, offset,
T_encoding_choice, hf_index, ett_ber_T_encoding,
&actx->external.encoding);
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index 5e68ff3b8f..9a7c1c9a7e 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -2600,6 +2600,8 @@ static const per_choice_t External_encoding_choice[] = {
static int
dissect_per_External_encoding(tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index) {
+ // This assertion is used to remove clang's warning.
+ DISSECTOR_ASSERT(actx);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_per_External_encoding, External_encoding_choice,
&actx->external.encoding);