dns.c: fix input validation fix
[project/mdnsd.git] / dns.c
diff --git a/dns.c b/dns.c
index c64f3b1be3d3e73fa4453a0158d850b958ce110e..1d3362f8b4953f86d079e8a61edc6390bbf6dda1 100644 (file)
--- a/dns.c
+++ b/dns.c
@@ -318,7 +318,7 @@ static int parse_answer(struct interface *iface, struct sockaddr *from,
        struct dns_answer *a;
        uint8_t *rdata;
 
        struct dns_answer *a;
        uint8_t *rdata;
 
-       if (!name || rlen < 0) {
+       if (!name || *rlen < 0) {
                fprintf(stderr, "dropping: bad question\n");
                return -1;
        }
                fprintf(stderr, "dropping: bad question\n");
                return -1;
        }