]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Handle queries that do not match any zone in Lua getZone call
authorHåkan Lindqvist <h@qw.se>
Sun, 6 Mar 2016 02:06:00 +0000 (03:06 +0100)
committerHåkan Lindqvist <h@qw.se>
Tue, 22 Mar 2016 23:10:37 +0000 (00:10 +0100)
pdns/lua-auth.cc

index 2df1e9cda089573bf4dbd05750277cd225e76696..47c7edb3c1d14b11154402ef00e86207f08fe731 100644 (file)
@@ -172,7 +172,10 @@ static int ldp_getWild(lua_State *L) {
 
 static int ldp_getZone(lua_State *L) {
   DNSPacket *p=ldp_checkDNSPacket(L);
-  lua_pushstring(L, p->qdomainzone.toString().c_str());
+  if(p->qdomainzone.empty())
+    lua_pushnil(L);
+  else
+    lua_pushstring(L, p->qdomainzone.toString().c_str());
   return 1;
 }