diff options
Diffstat (limited to 'wiretap/k12text.l')
-rw-r--r-- | wiretap/k12text.l | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/wiretap/k12text.l b/wiretap/k12text.l index ebec0ac7b9..afdc267cba 100644 --- a/wiretap/k12text.l +++ b/wiretap/k12text.l @@ -375,6 +375,12 @@ k12text_dump(wtap_dumper *wdh _U_, const struct wtap_pkthdr *phdr, gboolean ret; struct tm *tmp; + /* Don't write anything bigger than we're willing to read. */ + if (phdr->caplen > WTAP_MAX_PACKET_SIZE) { + *err = WTAP_ERR_PACKET_TOO_LARGE; + return FALSE; + } + str_enc = NULL; for(i=0; encaps[i].s; i++) { if (phdr->pkt_encap == encaps[i].e) { |