Ethereal-dev: Re: [Ethereal-dev] Packet reassemble in P_Mul [PATCH]

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gerald Combs <gerald@xxxxxxxxxxxx>
Date: Tue, 08 Nov 2005 16:34:39 -0600
Stig Bj�rlykke wrote:
> Hi list.
> 
> I just learned how easy it is to reassemble multiple UDP packets, so  I
> had to implement this for the P_Mul protocol :)
> 
> This patch fixes:
> * Reassemble multiple data packets
> * Add packet length check
> * Fix for PDU type in tree entry

You have:

  pdu_length = tvb_get_ntohs (tvb, offset);

    [ ... ]

    data_len = pdu_length - offset;

    [ ... ]

      frag_msg = fragment_add_seq_check (tvb, offset, pinfo, message_id,
                                         p_mul_fragment_table,
                                         p_mul_reassembled_table,
                                         seq_no,
                                         data_len, TRUE);

What happens if "pdu_length" is less than "offset"?