aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/epan
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-11-15 17:08:53 -0500
committerJohn Thacker <johnthacker@gmail.com>2022-11-15 17:08:53 -0500
commit1a04473ca8497aca9c49e12d218feeae5c8e6f2c (patch)
treeb86d96fb6dec1c6f0131ae25f5cd1fd3d425d211 /plugins/epan
parent99d3112464295290efc854f7b17c628fddb7e2fd (diff)
opcua: Quiet a Coverity warning
It really shouldn't be possible to have a fragment head with no fragment items here, but quiet Coverity CID 1516904 here.
Diffstat (limited to 'plugins/epan')
-rw-r--r--plugins/epan/opcua/opcua.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/epan/opcua/opcua.c b/plugins/epan/opcua/opcua.c
index 2eb3884f5b..e1dd43607a 100644
--- a/plugins/epan/opcua/opcua.c
+++ b/plugins/epan/opcua/opcua.c
@@ -283,7 +283,14 @@ static int dissect_opcua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
this way Wireshark reassembles the message, as it expects the fragment
sequence numbers to start at 0 */
for (frag_i = frag_msg->next; frag_i; frag_i = frag_i->next) {}
- opcua_seqnum = frag_i->offset + 1;
+ if (frag_i) {
+ opcua_seqnum = frag_i->offset + 1;
+ } else {
+ /* We should never have a fragment head with no fragment items, but
+ * just in case.
+ */
+ opcua_seqnum = 0;
+ }
if (chunkType == 'F')
{