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 c64f3b1..1d3362f 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;
        }