bd7bf7f8c2
fix bnc#697516 OBS-URL: https://build.opensuse.org/request/show/76454 OBS-URL: https://build.opensuse.org/package/show/network:utilities/wireshark?expand=0&rev=42
20 lines
710 B
Diff
20 lines
710 B
Diff
--- trunk/wiretap/snoop.c 2011/05/11 20:40:14 37067
|
|
+++ trunk/wiretap/snoop.c 2011/05/11 22:36:59 37068
|
|
@@ -473,6 +473,16 @@
|
|
rec_size = g_ntohl(hdr.rec_len);
|
|
orig_size = g_ntohl(hdr.orig_len);
|
|
packet_size = g_ntohl(hdr.incl_len);
|
|
+ if (orig_size > WTAP_MAX_PACKET_SIZE) {
|
|
+ /*
|
|
+ * Probably a corrupt capture file; don't blow up trying
|
|
+ * to allocate space for an immensely-large packet.
|
|
+ */
|
|
+ *err = WTAP_ERR_BAD_RECORD;
|
|
+ *err_info = g_strdup_printf("snoop: File has %u-byte original length, bigger than maximum of %u",
|
|
+ orig_size, WTAP_MAX_PACKET_SIZE);
|
|
+ return FALSE;
|
|
+ }
|
|
if (packet_size > WTAP_MAX_PACKET_SIZE) {
|
|
/*
|
|
* Probably a corrupt capture file; don't blow up trying
|