segfault nsd 1.4 aplha

Miek Gieben miekg at atoom.net
Wed Dec 17 13:29:43 UTC 2003


[On 17 Dec, @13:53, Roy wrote in "segfault nsd 1.4 aplha ..."]
> Hi,
> 
> to reproduce:
> 
> compile an empty database (nsd.zones with no statements) and run nsd.
> Segfault on first received query.

this should fix that:

diff -u -r1.165 query.c
--- query.c     15 Dec 2003 13:30:11 -0000      1.165
+++ query.c     17 Dec 2003 13:28:43 -0000
@@ -801,7 +801,7 @@
        exact = namedb_lookup(nsd->db, q->name, &closest_match, &closest_encloser);
        if (!closest_encloser->is_existing) {
                exact = 0;
-               while (!closest_encloser->is_existing)
+               while (closest_encloser != NULL && !closest_encloser->is_existing)
                        closest_encloser = closest_encloser->parent;
        }
 

grtz Miek



More information about the nsd-users mailing list