]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/zonecut: check for parent of root
authorMarek Vavruša <marek.vavrusa@nic.cz>
Tue, 9 Jun 2015 18:31:36 +0000 (20:31 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Tue, 9 Jun 2015 18:31:36 +0000 (20:31 +0200)
lib/zonecut.c

index 3cfef50481beec826f92d9edb9937f0f4a8fb183..143336fef3162b35c0e992eaec04d422d404026c 100644 (file)
@@ -254,12 +254,12 @@ int kr_zonecut_find_cached(struct kr_context *ctx, struct kr_zonecut *cut, const
 
        /* Start at QNAME parent. */
        name = knot_wire_next_label(name, NULL);
-       while (txn) {
+       while (txn && name) {
                if (fetch_ns(ctx, cut, name, txn, timestamp) == 0) {
                        update_cut_name(cut, name);
                        return kr_ok();
                }
-               if (name[0] == '\0') {
+               if (!name || !name[0]) {
                        break;
                }
                /* Subtract label from QNAME. */