Hi list,

From the source code of packet-msrp.c

static gboolean
check_msrp_header(tvbuff_t *tvb)
{
...
    linelen = tvb_find_line_end(tvb, 0, -1, &next_offset, FALSE);
    /* Find the first SP */
    space_offset = tvb_find_guint8(tvb, 0, -1, ' ');

...

    token_1_len = space_offset;
    token_2_start = space_offset + 1;
    space_offset = tvb_find_guint8(tvb, token_2_start, -1, ' ');

...
}

Why find the line length first, then to start searching to the end of the TVB?
A comment suggests that tvb_get_ptr() was used previously, so this might be a botched rework of that code?

Thanks,
Jaap
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:[email protected]?subject=unsubscribe

Reply via email to