Wireshark-dev: [Wireshark-dev] Why isn't this a bug (2)?

From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Sat, 09 Jul 2011 08:29:17 +0200
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