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_pktmeta.c

    r8b98289 r411666a  
    2626
    2727        if (remaining) {
    28                 if (*remaining < sizeof(*sll))
     28                if (*remaining <= sizeof(*sll))
    2929                        return NULL;
    3030                *remaining-=sizeof(*sll);
     
    4343        libtrace_pflog_header_t *pflog = (libtrace_pflog_header_t*)link;
    4444        if (remaining) {
    45                 if (*remaining<sizeof(*pflog))
     45                if (*remaining<=sizeof(*pflog))
    4646                        return NULL;
    4747                *remaining-=sizeof(*pflog);
     
    5858{
    5959        if (remaining) {
    60                 if (*remaining<144)
     60                if (*remaining<=144)
    6161                        return NULL;
    6262                *remaining-=144;
     
    7575        uint16_t rtaplen = bswap_le_to_host16(rtap->it_len);
    7676        if (remaining) {
    77                 if (*remaining < rtaplen)
     77                if (*remaining <= rtaplen)
    7878                        return NULL;
    7979                *remaining -= rtaplen;
Note: See TracChangeset for help on using the changeset viewer.