Show
Ignore:
Timestamp:
04/22/06 15:57:30 (4 years ago)
Author:
ahu
Message:

fix crash on malformed EDNS0 packet (thanks David G)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/dnsparser.cc

    r731 r760  
    244244bool MOADNSParser::getEDNSOpts(EDNSOpts* eo) 
    245245{ 
    246   if(d_header.arcount) { 
     246  if(d_header.arcount && !d_answers.empty()) { 
    247247    eo->d_packetsize=d_answers.back().first.d_class; 
    248248    struct Stuff { 
     
    250250      uint16_t Z; 
    251251    } __attribute__((packed)); 
    252      
     252      
    253253    Stuff stuff; 
    254254    uint32_t ttl=ntohl(d_answers.back().first.d_ttl);