Ignore:
Timestamp:
12/19/07 11:17:58 (13 years ago)
Author:
Shane Alcock <salcock@…>
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:
a78665c
Parents:
287b2b4
Message:
  • Fixed get_payload_from_X functions not returning NULL in cases where they have a full X header but no subsequent payload (i.e. remaining would be exactly 0 upon return)
  • trace_get_layer3 should not be a SIMPLE_FUNCTION anymore
  • trace_get_ip now checks that at least a full IPv4 header is present
  • Calls to payload_from_ethernet functions inside trace_get_layer3 will now update remaining correctly
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_transport.c

    ra81d2fc r411666a  
    1919        transport = trace_get_layer3(packet,&ethertype,remaining);
    2020
    21         if (!transport)
     21        if (!transport || *remaining == 0)
    2222                return NULL;
    2323
     
    118118{
    119119        if (remaining) {
    120                 if (*remaining < sizeof(libtrace_udp_t))
     120                if (*remaining <= sizeof(libtrace_udp_t))
    121121                        return NULL;
    122122                *remaining-=sizeof(libtrace_udp_t);
     
    129129        unsigned int dlen = tcp->doff*4;
    130130        if (remaining) {
    131                 if (*remaining < dlen)
     131                if (*remaining <= dlen)
    132132                        return NULL;
    133133                *remaining-=dlen;
     
    139139{
    140140        if (remaining) {
    141                 if (*remaining < sizeof(libtrace_icmp_t))
     141                if (*remaining <= sizeof(libtrace_icmp_t))
    142142                        return NULL;
    143143                *remaining-=sizeof(libtrace_icmp_t);
Note: See TracChangeset for help on using the changeset viewer.