Wireshark mailing list archives
Why isn't this a bug (2)?
From: Jaap Keuter <jaap.keuter () xs4all nl>
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 ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Why isn't this a bug (2)? Jaap Keuter (Jul 08)
- Re: Why isn't this a bug (2)? Chris Maynard (Jul 10)
- Re: Why isn't this a bug (2)? Jaap Keuter (Jul 10)
- Re: Why isn't this a bug (2)? Anders Broman (Jul 10)
- Re: Why isn't this a bug (2)? Jaap Keuter (Jul 10)
- Re: Why isn't this a bug (2)? Chris Maynard (Jul 10)
