diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-04-29 18:47:49 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-04-30 01:50:31 +0000 |
commit | 55cc5da8c89182c765c197dff75546c011b174f6 (patch) | |
tree | c96ea381a915ebfb90760842f804f2265177354c /wiretap/eyesdn.c | |
parent | 6a140eca7b78b230f1f90a739a32257476513c78 (diff) | |
download | wireshark-55cc5da8c89182c765c197dff75546c011b174f6.tar.gz |
Use WTAP_MAX_PACKET_SIZE as the maximum packet length.
And use the actual packet length, rather than a fixed value, as the
buffer size we need for the packet.
Change-Id: I3af6724210a85b50610839d1bdf97fcf5a152b2f
Reviewed-on: https://code.wireshark.org/review/15179
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/eyesdn.c')
-rw-r--r-- | wiretap/eyesdn.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/wiretap/eyesdn.c b/wiretap/eyesdn.c index 5ab651a3a4..c545373ffe 100644 --- a/wiretap/eyesdn.c +++ b/wiretap/eyesdn.c @@ -97,11 +97,6 @@ static const unsigned char eyesdn_hdr_magic[] = /* Size of a record header */ #define EYESDN_HDR_LENGTH 12 -/* - * XXX - is this the biggest packet we can get? - */ -#define EYESDN_MAX_PACKET_LEN 16384 - static gboolean eyesdn_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset); static gboolean eyesdn_seek_read(wtap *wth, gint64 seek_off, @@ -305,10 +300,10 @@ read_eyesdn_rec(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, int *err, break; } - if(pkt_len > EYESDN_MAX_PACKET_LEN) { + if(pkt_len > WTAP_MAX_PACKET_SIZE) { *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup_printf("eyesdn: File has %u-byte packet, bigger than maximum of %u", - pkt_len, EYESDN_MAX_PACKET_LEN); + pkt_len, WTAP_MAX_PACKET_SIZE); return FALSE; } @@ -320,7 +315,7 @@ read_eyesdn_rec(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, int *err, phdr->len = pkt_len; /* Make sure we have enough room for the packet */ - ws_buffer_assure_space(buf, EYESDN_MAX_PACKET_LEN); + ws_buffer_assure_space(buf, pkt_len); pd = ws_buffer_start_ptr(buf); if (!esc_read(fh, pd, pkt_len, err, err_info)) |