From 1a04473ca8497aca9c49e12d218feeae5c8e6f2c Mon Sep 17 00:00:00 2001 From: John Thacker Date: Tue, 15 Nov 2022 17:08:53 -0500 Subject: [PATCH] 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. --- plugins/epan/opcua/opcua.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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') {