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') {