Ignore:
Timestamp:
05/29/08 11:44:54 (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:
3a87f4f
Parents:
ae8ec56
Message:
  • Updated all get_payload_from_X functions to set remaining to zero if they are returning NULL rather than have remaining be "undefined" upon return
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_transport.c

    r411666a r35782f6  
    118118{
    119119        if (remaining) {
    120                 if (*remaining <= sizeof(libtrace_udp_t))
     120                if (*remaining <= sizeof(libtrace_udp_t)) {
     121                        *remaining = 0;
    121122                        return NULL;
     123                }
    122124                *remaining-=sizeof(libtrace_udp_t);
    123125        }
     
    129131        unsigned int dlen = tcp->doff*4;
    130132        if (remaining) {
    131                 if (*remaining <= dlen)
     133                if (*remaining <= dlen) {
     134                        *remaining = 0;
    132135                        return NULL;
     136                }
    133137                *remaining-=dlen;
    134138        }
     
    139143{
    140144        if (remaining) {
    141                 if (*remaining <= sizeof(libtrace_icmp_t))
     145                if (*remaining <= sizeof(libtrace_icmp_t)) {
     146                        *remaining = 0;
    142147                        return NULL;
     148                }
    143149                *remaining-=sizeof(libtrace_icmp_t);
    144150        }
Note: See TracChangeset for help on using the changeset viewer.