reported in bug 3849.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29364
f5534014-38df-0310-8fa8-
9805f1628bb7
/* The file_seek function do not return an error if the end of file
is reached whereas the record is truncated */
+ if (packet_size > WTAP_MAX_PACKET_SIZE) {
+ /*
+ * Probably a corrupt capture file; don't blow up trying
+ * to allocate space for an immensely-large packet.
+ */
+ return 0;
+ }
buffer=g_malloc(packet_size);
r = file_read(buffer, 1, packet_size, wth->fh);
g_free(buffer);