X-Git-Url: https://git.tcpdump.org/libpcap/blobdiff_plain/c71f77c657dc3e23bb42298843ab5d682b3daad2..a8cd00e8ae4468a9e64cfa9ee38972b950024bbd:/sf-pcap.c diff --git a/sf-pcap.c b/sf-pcap.c index b298131a..8180bc9d 100644 --- a/sf-pcap.c +++ b/sf-pcap.c @@ -371,9 +371,9 @@ pcap_check_header(bpf_u_int32 magic, FILE *fp, u_int precision, char *errbuf, 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) { @@ -500,7 +500,7 @@ pcap_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char **data) 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);