EXTRA_DIST = manpages \
markdown
-.PHONY: html manpages
+.PHONY: html all-manpages
html: html/index.html
html/index.html: process-md.sh mkdocs.yml markdown/** markdown/*/** manpages/*
html.tar.bz2: html
tar cjf html.tar.bz2 html/
-manpages: $(MANPAGES_TARGET_ALL)
+all-manpages: $(MANPAGES_TARGET_ALL)
if HAVE_PANDOC
$(MANPAGES_TARGET_ALL): %: manpages/%.md
The recursor has been reported to crash for some OS X users.
### OpenBSD
-Compiles but then does not work very well. We hear that it may work with more
-recent versions of gcc, please let us know on `<pdns-dev@mailman.powerdns.com>`.
+Compiles, but use gmake.
### Solaris
Solaris 8 and 9 work fine. The 'Sunpro' compiler has not been tried but is
AS_IF([test "x$with_lua" != "xno"],[
AS_IF([test "x$with_lua" = "xyes" -o "x$with_lua" = "xauto"],
- [for LUAPC in lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1 lua; do
+ [for LUAPC in lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua; do
PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [
AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have lua])
with_lua=yes
while(getline(f,pline)) {
trim_right(pline);
- if(pline[pline.size()-1]=='\\') {
+ if(!pline.empty() && pline[pline.size()-1]=='\\') {
line+=pline.substr(0,pline.length()-1);
continue;
}
DNSName::DNSName(const char* pos, int len, int offset, bool uncompress, uint16_t* qtype, uint16_t* qclass, unsigned int* consumed)
{
+ d_recurse = 0;
packetParser(pos, len, offset, uncompress, qtype, qclass, consumed);
}
labellen &= (~0xc0);
int newpos = (labellen << 8) + *(const unsigned char*)pos;
- if(newpos < offset)
+ if(newpos < offset) {
+ if (++d_recurse > 100)
+ throw std::range_error("Abort label decompression after 100 redirects");
packetParser(opos, len, newpos, true);
- else
+ } else
throw std::range_error("Found a forward reference during label decompression");
pos++;
break;
// typedef __gnu_cxx::__sso_string string_t;
typedef std::string string_t;
string_t d_storage;
+ int d_recurse;
void packetParser(const char* p, int len, int offset, bool uncompress, uint16_t* qtype=0, uint16_t* qclass=0, unsigned int* consumed=0);
static std::string escapeLabel(const std::string& orig);
*/
#ifndef MISC_HH
#define MISC_HH
+#include <errno.h>
#include <inttypes.h>
#include <cstring>
#include <cstdio>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <unistd.h>
#include "dns_random.hh"
void seedRandom(const string& source)
BOOST_CHECK_THROW(DNSName dn(name.c_str(), name.size(), 0, true), std::range_error);
}
+BOOST_AUTO_TEST_CASE(test_compression_loop2) { // Compression loop (deep recursion)
+
+ int i;
+ string name("\x00\xc0\x00", 3);
+ for (i=0; i<98; ++i) {
+ name.append( 1, ((i >> 7) & 0xff) | 0xc0);
+ name.append( 1, ((i << 1) & 0xff) | 0x01);
+ }
+ BOOST_CHECK_NO_THROW(DNSName dn(name.c_str(), name.size(), name.size()-2, true));
+
+ ++i;
+ name.append( 1, ((i >> 7) & 0xff) | 0xc0);
+ name.append( 1, ((i << 1) & 0xff) | 0x01);
+
+ BOOST_CHECK_THROW(DNSName dn(name.c_str(), name.size(), name.size()-2, true), std::range_error);
+}
BOOST_AUTO_TEST_SUITE_END()