]> granicus.if.org Git - pdns/commitdiff
don't toString an empty dnsname
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 18 Jan 2016 11:38:30 +0000 (12:38 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 18 Jan 2016 11:38:30 +0000 (12:38 +0100)
pdns/lua-auth.cc

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