diff options
Diffstat (limited to 'wiretap/dct3trace.c')
-rw-r--r-- | wiretap/dct3trace.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/wiretap/dct3trace.c b/wiretap/dct3trace.c index 2346cba611..f49c2d1e76 100644 --- a/wiretap/dct3trace.c +++ b/wiretap/dct3trace.c @@ -76,7 +76,7 @@ static const char dct3trace_magic_end[] = "</dump>"; static gboolean dct3trace_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset); static gboolean dct3trace_seek_read(wtap *wth, gint64 seek_off, - struct wtap_pkthdr *phdr, guint8 *pd, int len, + struct wtap_pkthdr *phdr, Buffer *buf, int len, int *err, gchar **err_info); /* @@ -347,17 +347,17 @@ static gboolean dct3trace_read(wtap *wth, int *err, gchar **err_info, /* Used to read packets in random-access fashion */ static gboolean dct3trace_seek_read (wtap *wth, gint64 seek_off, - struct wtap_pkthdr *phdr, guint8 *pd, int len, + struct wtap_pkthdr *phdr, Buffer *buf, int len, int *err, gchar **err_info) { - unsigned char buf[MAX_PACKET_LEN]; + unsigned char databuf[MAX_PACKET_LEN]; if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) { return FALSE; } - if( !dct3trace_get_packet(wth->random_fh, phdr, buf, err, err_info) ) + if( !dct3trace_get_packet(wth->random_fh, phdr, databuf, err, err_info) ) { return FALSE; } @@ -377,6 +377,8 @@ static gboolean dct3trace_seek_read (wtap *wth, gint64 seek_off, return FALSE; } - memcpy( pd, buf, phdr->caplen ); + /* Make sure we have enough room for the packet */ + buffer_assure_space(buf, phdr->caplen); + memcpy( buffer_start_ptr(buf), databuf, phdr->caplen ); return TRUE; } |