diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-01-06 11:42:56 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-01-06 19:43:33 +0000 |
commit | 0168b71cfd6517baf7062b2fc61114f3d49b2299 (patch) | |
tree | 6872fabd26c3c9455ea50cb886b2e899df1690fa /epan | |
parent | ffb3328d1fb10f599bdd25e98f75c39acd2c0ed9 (diff) |
Require that dissect_atm_pw_oam_cell() be called with a non-null data pointer.
The only place where it's currently called passes it data.
Do a DISSECTOR_ASSERT() check to make sure it's non-null.
Remove null-pointer checks that this renders no longer necessary.
Change-Id: I2fc86f9591a7126d328029379ecfe98400dd01cb
Reviewed-on: https://code.wireshark.org/review/31419
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-atm.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index 968ff923ca..b5c1089f9e 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -1342,9 +1342,9 @@ dissect_atm_cell_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, * First check whether custom dissection table * was set up to dissect this VPI+VCI combination */ - if (atm_info && dissector_try_uint_new(atm_cell_payload_vpi_vci_table, - ((atm_info->vpi) << 16) | atm_info->vci, - next_tvb, pinfo, tree, TRUE, atm_info)) + if (dissector_try_uint_new(atm_cell_payload_vpi_vci_table, + ((atm_info->vpi) << 16) | atm_info->vci, + next_tvb, pinfo, tree, TRUE, atm_info)) { return; } @@ -1733,15 +1733,13 @@ dissect_atm_pw_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi { struct pw_atm_phdr *pw_atm_info = (struct pw_atm_phdr *)data; - col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATM"); + DISSECTOR_ASSERT(pw_atm_info != NULL); - if (pw_atm_info) { - dissect_atm_cell_payload(tvb, 0, pinfo, tree, AAL_OAMCELL, - pw_atm_info->enable_fill_columns_by_atm_dissector, - &pw_atm_info->info); - } else { - dissect_atm_cell_payload(tvb, 0, pinfo, tree, AAL_OAMCELL, TRUE, NULL); - } + col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATM"); + + dissect_atm_cell_payload(tvb, 0, pinfo, tree, AAL_OAMCELL, + pw_atm_info->enable_fill_columns_by_atm_dissector, + &pw_atm_info->info); return tvb_reported_length(tvb); } |