From 122ac1a25d7a506aacfe71687254dea8e0311ad8 Mon Sep 17 00:00:00 2001 From: chengzhicn Date: Fri, 13 Oct 2017 03:08:12 +0800 Subject: [PATCH] check error returned by dns_decode before this commit, sending "GET / HTTP/1.1" to server will cause uninitialized variable access. --- src/iodined.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iodined.c b/src/iodined.c index 339db6f..a227b75 100644 --- a/src/iodined.c +++ b/src/iodined.c @@ -2068,7 +2068,7 @@ read_dns(int fd, struct dnsfd *dns_fds, int tun_fd, struct query *q) if (raw_decode(packet, r, q, fd, dns_fds, tun_fd)) { return 0; } - if (dns_decode(NULL, 0, q, QR_QUERY, packet, r) < 0) { + if (dns_decode(NULL, 0, q, QR_QUERY, packet, r) <= 0) { return 0; }