diff options
author | Martin Mathieson <martin.mathieson@keysight.com> | 2020-05-07 18:25:35 +0100 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2020-05-09 11:34:12 +0000 |
commit | 569f3bd6111cfebe2fcd62484d854a053b5c9636 (patch) | |
tree | 7e2ab4811b1701db2f6a65243d47a36c6136dcfe /ui | |
parent | d795711a49184da6761fedbd91515cdc432d3ac7 (diff) |
More PVS-Studio issues flagged by Valerii Zapodovnikov.
/opt/SourceCode/wireshark/epan/dissectors/packet-frame.c 818 warn V547 Expression 'fi' is always true.
/opt/SourceCode/wireshark/epan/dissectors/packet-gsm_sms.c 2692 warn V547 Expression 'length <= (offset - saved_offset)' is always false.
/opt/SourceCode/wireshark/epan/dissectors/packet-isup.c 4688 warn V1037 Two or more case-branches perform the same actions. Check lines: 4688, 4697
/opt/SourceCode/wireshark/extcap/androiddump.c 1237 warn V560 A part of conditional expression is always true: data_str.
/opt/SourceCode/wireshark/extcap/androiddump.c 1603 warn V547 Expression is always true.
/opt/SourceCode/wireshark/ui/qt/models/packet_list_model.cpp 497 warn V560 A part of conditional expression is always true: ok_r1.
For the voip_calls.c change, I preferred to initailize along with every other field, rather than set to actual value it gets set to later.
For the isobus-vt change, I could not find a spec but followed the pattern from other error bit fields.
Bug: 16335
Change-Id: Ie55082222b582f6fff4e8c7a992d863acee6cf15
Reviewed-on: https://code.wireshark.org/review/37160
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/models/packet_list_model.cpp | 2 | ||||
-rw-r--r-- | ui/voip_calls.c | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/ui/qt/models/packet_list_model.cpp b/ui/qt/models/packet_list_model.cpp index 9d1396f90e..12d057e0fd 100644 --- a/ui/qt/models/packet_list_model.cpp +++ b/ui/qt/models/packet_list_model.cpp @@ -494,7 +494,7 @@ bool PacketListModel::recordLessThan(PacketListRecord *r1, PacketListRecord *r2) // either r1 is invalid (and sort it before others) or both // r1 and r2 are valid (sort normally) cmp_val = -1; - } else if (!ok_r2 || (ok_r1 && num_r1 > num_r2)) { + } else if (!ok_r2 || (num_r1 > num_r2)) { cmp_val = 1; } } else { diff --git a/ui/voip_calls.c b/ui/voip_calls.c index 737c1f3983..8613411035 100644 --- a/ui/voip_calls.c +++ b/ui/voip_calls.c @@ -1442,9 +1442,7 @@ isup_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, tapinfo->completed_calls++; } /* Overwrite any comment set above */ - if (comment) { - g_free(comment); - } + g_free(comment); comment = g_strdup_printf("Cause %i - %s", pi->cause_value, val_to_str_ext_const(pi->cause_value, &q931_cause_code_vals_ext, "(Unknown)")); @@ -3655,7 +3653,7 @@ unistim_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *e } else if(pi->stream_connect == 1 && callsinfo == NULL) { /* Research indicates some nortel products initiate stream first - * without keypresses. therefore creating this solely on a keypress is + * without keypresses, therefore creating this solely on a keypress is * ineffective. * Sometimes calls start immediately with open stream. */ @@ -3679,7 +3677,7 @@ unistim_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *e /* Clear tap struct */ tmp_unistim_info->rudp_type = 0; tmp_unistim_info->payload_type = 0; - tmp_unistim_info->sequence = pi->sequence; + tmp_unistim_info->sequence = 0; tmp_unistim_info->termid = 0; tmp_unistim_info->key_val = -1; tmp_unistim_info->key_state = -1; |