p->bufsize = p->snapshot;
if (p->bufsize <= 0) {
/*
- * Bogus snapshot length; use 64KiB as a fallback.
+ * Bogus snapshot length; use the maximum as a fallback.
*/
- p->bufsize = 65536;
+ p->bufsize = MAXIMUM_SNAPLEN;
}
p->buffer = malloc(p->bufsize);
if (p->buffer == NULL) {
static u_char *tp = NULL;
static size_t tsize = 0;
- if (hdr->caplen > 65535) {
+ if (hdr->caplen > MAXIMUM_SNAPLEN) {
snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
"bogus savefile header");
return (-1);