forked from osmocom/wireshark
Don't use the length argument to the seek-read routine; no other
seek-read routine does that. Pass the length we just filled in to buffer_assure_space() in the seek-read routine, and use that in the memcpy() as well. svn path=/trunk/; revision=54568
This commit is contained in:
parent
d91261a53b
commit
11e4e670a4
|
@ -291,7 +291,7 @@ k12text_read(wtap *wth, int *err, char ** err_info, gint64 *data_offset)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
k12text_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int length, int *err, char **err_info)
|
||||
k12text_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int length _U_, int *err, char **err_info)
|
||||
{
|
||||
if ( file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) {
|
||||
return FALSE;
|
||||
|
@ -312,18 +312,10 @@ k12text_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* verify frame length parsed this time against original frame length */
|
||||
if (ii != (guint)length) {
|
||||
/* What happened ? This now seems to have a different length than originally */
|
||||
*err = WTAP_ERR_BAD_FILE;
|
||||
*err_info = g_strdup("Incorrect frame length (program error ?)");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
k12text_set_headers(phdr);
|
||||
|
||||
buffer_assure_space(buf, wth->phdr.caplen);
|
||||
memcpy(buffer_start_ptr(buf), bb, length);
|
||||
buffer_assure_space(buf, phdr->caplen);
|
||||
memcpy(buffer_start_ptr(buf), bb, phdr->caplen);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue