diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-01-02 20:17:24 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-01-02 20:17:24 +0000 |
commit | 11e4e670a4578ea7f8efc0902b2353e9aea1c32a (patch) | |
tree | b8591e61d8d608c440ed0dea8e31ab95568ead9d /wiretap/k12text.l | |
parent | d91261a53b1ca12e70079a0b4ab3de13d8783385 (diff) |
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
Diffstat (limited to 'wiretap/k12text.l')
-rw-r--r-- | wiretap/k12text.l | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/wiretap/k12text.l b/wiretap/k12text.l index 56ea91b684..077d5c6246 100644 --- a/wiretap/k12text.l +++ b/wiretap/k12text.l @@ -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; } |