aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/eyesdn.c
diff options
context:
space:
mode:
Diffstat (limited to 'wiretap/eyesdn.c')
-rw-r--r--wiretap/eyesdn.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/wiretap/eyesdn.c b/wiretap/eyesdn.c
index 66897b81df..ea0af9ffdd 100644
--- a/wiretap/eyesdn.c
+++ b/wiretap/eyesdn.c
@@ -417,6 +417,14 @@ static gboolean eyesdn_dump(wtap_dumper *wdh,
int protocol;
int size;
+ /* Don't write out anything bigger than we can read.
+ * (The length field in packet headers is 16 bits, which
+ * imposes a hard limit.) */
+ if (phdr->caplen > 65535) {
+ *err = WTAP_ERR_PACKET_TOO_LARGE;
+ return FALSE;
+ }
+
usecs=phdr->ts.nsecs/1000;
secs=phdr->ts.secs;
size=phdr->caplen;