rlen=g_ntohs(header.rlen);
wlen=g_ntohs(header.wlen);
- packet_size = rlen - (guint32)sizeof(header);
/* fail on invalid record type, invalid rlen, timestamps decreasing, or incrementing too far */
return 0;
}
+ packet_size = rlen - (guint32)sizeof(header);
if (packet_size > WTAP_MAX_PACKET_SIZE) {
/*
- * Probably a corrupt capture file; don't blow up trying
+ * Probably a corrupt capture file or a file that's not an ERF file
+ * but that passed earlier tests; don't blow up trying
* to allocate space for an immensely-large packet.
*/
return 0;