Show
Ignore:
Timestamp:
04/13/06 16:20:19 (7 years ago)
Author:
ahu
Message:

prevent possible crashes (score one for valgrind)

Files:
1 modified

Legend:

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

    r687 r690  
    1717  d_content.resize(len + sizeof(dnsheader)); 
    1818  uint8_t* dptr=(&*d_content.begin()) + len; 
    19  
     19   
    2020  memcpy(dptr, ptr, sizeof(dnsheader)); 
    21  
     21  d_stuff=0; 
    2222  xfrLabel(qname, false); 
    2323   
     
    141141      goto out;                                 // skip trailing 0 in case of compression 
    142142    } 
     143 
     144    if(li==d_labelmap.end() && pos< 16384) 
     145      d_labelmap[chopped]=pos;                       //  if untrue, we need to count - also, don't store offsets > 16384, won't work 
    143146     
    144     if(li==d_labelmap.end() && pos < 16384) {  
    145       d_labelmap[chopped]=pos;                       //  if untrue, we need to count - also, don't store offsets > 16384, won't work 
    146     } 
    147147    d_record.push_back((char)(i->second - i->first)); 
    148148    unsigned int len=d_record.size();