dns.c: fix input validation fix
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Fri, 24 Apr 2020 10:01:12 +0000 (11:01 +0100)
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Fri, 24 Apr 2020 10:02:21 +0000 (11:02 +0100)
Thanks to Guido Vranken <guido@guidovranken.com> for pointing out I'd
forgotten to de-ref a pointer in the previous fix.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
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;
 
-       if (!name || rlen < 0) {
+       if (!name || *rlen < 0) {
                fprintf(stderr, "dropping: bad question\n");
                return -1;
        }