Skip to content

Commit 662e76d

Browse files
committed
Fix segfault in zone2lmdb
$ ./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)
1 parent d38cfb6 commit 662e76d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pdns/zone2lmdb.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ try
238238

239239
int count=0;
240240

241+
openDB();
242+
241243
if(zonefile.empty()) {
242244
BindParser BP;
243245
BP.setVerbose(::arg().mustDo("verbose"));
@@ -258,7 +260,6 @@ try
258260
int tick=numdomains/100;
259261

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

0 commit comments

Comments
 (0)