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.
This commit is contained in:
John Thacker 2022-11-15 17:08:53 -05:00
parent 99d3112464
commit 1a04473ca8
1 changed files with 8 additions and 1 deletions

View File

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