]> The Tcpdump Group git mirrors - libpcap/blobdiff - sf-pcap.c
Don't treat 65535 as the maximum snapshot length.
[libpcap] / sf-pcap.c
index b298131aa06f7de54269f61b14d43506a6cbc0eb..8180bc9d8da9184a6650c286689ce00337fdb5cb 100644 (file)
--- 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);