Skip to content

Commit

Permalink
Fix segfault in zone2lmdb
Browse files Browse the repository at this point in the history
$ ./pdns/zone2lmdb --zone=./regression-tests.recursor/configs/10.0.3.10/example.net.zone
ASAN:SIGSEGV
=================================================================
==25526==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000000c
(pc 0x7fe8b57a4d50 bp 0x7ffedb062f90 sp 0x7ffedb061d58 T0)
    #0 0x7fe8b57a4d4f  (/lib64/liblmdb.so.0.0.0+0x4d4f)
    #1 0x7fe8b6c4c1aa in emitData(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >, ZoneParserTNG&)
/home/ruben/src/pdns/pdns/zone2lmdb.cc:99
    #2 0x7fe8b6c4f301 in main /home/ruben/src/pdns/pdns/zone2lmdb.cc:295
    #3 0x7fe8b493b83f in __libc_start_main (/lib64/libc.so.6+0x2083f)
    #4 0x7fe8b6b6ef88 in _start
(/home/ruben/src/pdns/pdns/zone2lmdb+0x27f88)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ??:0 ??
==25526==ABORTING

(cherry picked from commit 372579c)
  • Loading branch information
rubenk committed Mar 3, 2015
1 parent d38cfb6 commit 662e76d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pdns/zone2lmdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ try

int count=0;

openDB();

if(zonefile.empty()) {
BindParser BP;
BP.setVerbose(::arg().mustDo("verbose"));
Expand All @@ -258,7 +260,6 @@ try
int tick=numdomains/100;

cout <<"[";
openDB();
for(vector<BindDomainInfo>::const_iterator i=domains.begin(); i!=domains.end(); ++i) {
if(i->type!="master" && i->type!="slave") {
cerr<<" Warning! Skipping '"<<i->type<<"' zone '"<<i->name<<"'"<<endl;
Expand Down

0 comments on commit 662e76d

Please sign in to comment.