Changeset 0f7f688


Ignore:
Timestamp:
10/12/05 16:47:43 (15 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:
16143a3
Parents:
2e22a5df
Message:

Added checks in the erf handler to make sure you don't read corrupt/legacy
traces as a non legacy format.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    reaa5529 r0f7f688  
    533533        assert(size < LIBTRACE_PACKET_BUFSIZE);
    534534        buffer2 = buffer + dag_record_size;
     535        /* If your trace is legacy, or corrupt, then this assert may fire. */
     536        assert(((dag_record_t *)buffer)->rlen <=
     537                        ((dag_record_t*)buffer)->wlen+sizeof(dag_record_t));
     538        /* If it's an unknown type, your trace is legacy */
     539        assert(((dag_record_t *)buffer)->type != 0);
     540        /* Unknown/corrupt */
     541        assert(((dag_record_t *)buffer)->type < 10);
    535542       
    536543        // read in the rest of the packet
Note: See TracChangeset for help on using the changeset viewer.