summaryrefslogtreecommitdiff
path: root/wiretap/visual.c
diff options
context:
space:
mode:
Diffstat (limited to 'wiretap/visual.c')
-rw-r--r--wiretap/visual.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wiretap/visual.c b/wiretap/visual.c
index d73fa2515a..a0822aa855 100644
--- a/wiretap/visual.c
+++ b/wiretap/visual.c
@@ -682,6 +682,12 @@ static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
guint delta_msec;
guint32 packet_status;
+ /* Don't write anything we're not willing to read. */
+ if (phdr->caplen > WTAP_MAX_PACKET_SIZE) {
+ *err = WTAP_ERR_PACKET_TOO_LARGE;
+ return FALSE;
+ }
+
/* If the visual structure was never allocated then nothing useful
can be done. */
if (visual == 0)