It is not guaranteed that the records in numerical (frame table) order

will be in sequential (byte offset) order in the file; don't treat the
record offset going backwards as an error.

svn path=/trunk/; revision=35291
This commit is contained in:
Guy Harris 2010-12-28 20:32:58 +00:00
parent d100b2d0e0
commit c8fd1ca472
1 changed files with 5 additions and 7 deletions

View File

@ -409,15 +409,13 @@ again:
may still cause a seek and a read of the underlying file,
so we don't want to do it unconditionally).
If the beginning of the current record is *before* the
current position, that's an error. */
Yes, the current record could be before the previous
record. At least some captures put the trailer record
with statistics as the first physical record in the
file, but set the frame table up so it's the last
record in sequence. */
rec_offset = netmon->frame_table[netmon->current_frame];
if (wth->data_offset != rec_offset) {
if (rec_offset < wth->data_offset) {
*err = WTAP_ERR_BAD_RECORD;
*err_info = g_strdup("netmon: Record offset is in the middle of an earlier record");
return FALSE;
}
wth->data_offset = rec_offset;
if (file_seek(wth->fh, wth->data_offset, SEEK_SET, err) == -1)
return FALSE;