]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/resolve: check for non-rd query input
authorMarek Vavruša <marek.vavrusa@nic.cz>
Sun, 26 Apr 2015 21:10:55 +0000 (23:10 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Sun, 26 Apr 2015 21:18:45 +0000 (23:18 +0200)
lib/resolve.c

index faefb2092fdc0523f39dd503278650c4d02d357c..3cf346fd421fe75be9f9600d0f44e2c1747e9323 100644 (file)
@@ -233,7 +233,10 @@ int kr_resolve_consume(struct kr_request *request, knot_pkt_t *packet)
        struct kr_query *qry = kr_rplan_current(rplan);
 
        /* Empty resolution plan, push packet as the new query */
-       if (kr_rplan_empty(rplan)) {
+       if (packet && kr_rplan_empty(rplan)) {
+               if (!knot_wire_get_rd(packet->wire)) {
+                       return KNOT_STATE_FAIL;
+               }
                if (knot_pkt_init_response(request->answer, packet) != 0) {
                        return KNOT_STATE_FAIL;
                }