Ignore:
Timestamp:
10/31/08 13:51:59 (5 years ago)
Author:
perry
Message:

If we have a complete header, but truncated at the end of it, we shouldn't return NULL from
get_payload_from_* functions so we can distinguish it from a truncated header.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/protocols_transport.c

    r1354 r1376  
    3737                         
    3838                default: 
     39                        printf("unknown ethertype=%04x\n",ethertype); 
    3940                        *proto=0; 
    4041                        return NULL; 
     
    118119{ 
    119120        if (remaining) { 
    120                 if (*remaining <= sizeof(libtrace_udp_t)) { 
     121                if (*remaining < sizeof(libtrace_udp_t)) { 
    121122                        *remaining = 0; 
    122123                        return NULL; 
     
    131132        unsigned int dlen = tcp->doff*4; 
    132133        if (remaining) { 
    133                 if (*remaining <= dlen) { 
     134                if (*remaining < dlen) { 
    134135                        *remaining = 0; 
    135136                        return NULL; 
     
    143144{ 
    144145        if (remaining) { 
    145                 if (*remaining <= sizeof(libtrace_icmp_t)) { 
     146                if (*remaining < sizeof(libtrace_icmp_t)) { 
    146147                        *remaining = 0; 
    147148                        return NULL; 
Note: See TracChangeset for help on using the changeset viewer.