Ignore:
Timestamp:
10/14/08 10:03:46 (13 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
8babb98
Parents:
3298e12
Message:

Be more aggressive in looking for bad packets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcapfile.c

    r5ceb545 r5c4e0c0  
    273273                        sizeof(libtrace_pcapfile_pkt_hdr_t));
    274274
     275        assert(swapl(libtrace,((libtrace_pcapfile_pkt_hdr_t*)packet->buffer)->caplen)<LIBTRACE_PACKET_BUFSIZE);
     276
    275277        if (err<0) {
    276278                trace_set_err(libtrace,errno,"reading packet");
     
    367369        hdr.ts_usec = tv.tv_usec;
    368370        hdr.caplen = trace_get_capture_length(packet);
     371        assert(hdr.caplen < LIBTRACE_PACKET_BUFSIZE);
    369372        /* PCAP doesn't include the FCS, we do */
    370373        if (linktype==TRACE_TYPE_ETH)
     
    377380        else
    378381                hdr.wirelen = trace_get_wire_length(packet);
     382
     383        assert(hdr.wirelen < LIBTRACE_PACKET_BUFSIZE);
    379384
    380385
Note: See TracChangeset for help on using the changeset viewer.