aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ip.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2020-05-04 22:49:12 +0100
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2020-05-06 08:35:11 +0000
commita5703f22cb723c46d5700cf3fffc8a9b40dd47d3 (patch)
treeee7bb5e4a9cb3b4410519f68aad207ce2b01356e /epan/dissectors/packet-ip.c
parent1d0b233f12e937f6278fc38775fca530e2be2661 (diff)
More changes arising from PVS-Studio output.
/opt/SourceCode/wireshark/epan/dissectors/packet-ip.c 1556 err V547 Expression 'opt == (1 | 0x00)' is always true. /opt/SourceCode/wireshark/epan/dissectors/packet-ipdc.c 739 warn V547 Expression 'payload_len < 4' is always false. /opt/SourceCode/wireshark/ui/text_import.c 1049 err V547 Expression 'info->offset_type == OFFSET_DEC' is always true. None of these are actual bugfixes. Bug: 16335 Change-Id: I6d0d3bb92c70ea625fc8b559e7a2bc5ba4e29e25 Reviewed-on: https://code.wireshark.org/review/37136 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'epan/dissectors/packet-ip.c')
-rw-r--r--epan/dissectors/packet-ip.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index 148e585175..107b3dc5d1 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -1553,7 +1553,8 @@ dissect_ip_options(tvbuff_t *tvb, int offset, guint length,
if (opt == IPOPT_EOOL)
{
local_proto = proto_ip_option_eol;
- } else if (opt == IPOPT_NOP) {
+ } else {
+ /* i.e. opt is IPOPT_NOP */
local_proto = proto_ip_option_nop;
if (opt_item && (nop_count == 0 || offset % 4)) {
@@ -1566,11 +1567,8 @@ dissect_ip_options(tvbuff_t *tvb, int offset, guint length,
} else {
nop_count = 0;
}
- } else {
- g_assert_not_reached();
}
-
field_item = proto_tree_add_item(opt_tree, local_proto, tvb, offset, 1, ENC_NA);
field_tree = proto_item_add_subtree(field_item, ett_ip_option_other);