From 4588aab71add14b1db4ef828d446799e70bcb38e Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Thu, 2 Nov 2006 06:38:16 +0000 Subject: [PATCH] Fix bof --- README | 3 ++- dns.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README b/README index 716b553..452e74c 100644 --- a/README +++ b/README @@ -67,7 +67,7 @@ If you have problems, try inspecting the traffic with network monitoring tools and make sure that the relaying DNS server has not cached the response. A cached error message could mean that you started the client before the server. -The upstream data is sent gzipped encoded in hexadecimal. DNS protocol allows +The upstream data is sent gzipped encoded with Base32. DNS protocol allows one query per packet, and one query can be max 256 chars. Each domain name part can be max 63 chars. So your domain name and subdomain should be as short as possible to allow maximum throughput. @@ -91,6 +91,7 @@ iodine has atomic number 53, which happens to be the DNS port number. THANKS: - To kuxien for FreeBSD and OS X testing +- To poplix for code audit AUTHORS & LICENSE: diff --git a/dns.c b/dns.c index 2692850..96bd5e8 100644 --- a/dns.c +++ b/dns.c @@ -320,11 +320,11 @@ dns_parse_reply(char *outbuf, int buflen, char *packet, int packetlen) readshort(packet, &data, &class); readlong(packet, &data, &ttl); readshort(packet, &data, &rlen); - readdata(packet, &data, rdata, rlen); + rv = MIN(rlen, sizeof(rdata)); + readdata(packet, &data, rdata, rv); } - if(type == T_NULL && rlen > 2) { - rv = MIN(rlen, sizeof(rdata)); + if(type == T_NULL && rv > 2) { memcpy(outbuf, rdata, rv); } }