aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-02 19:36:19 +0100
committerKim Alvefur <zash@zash.se>2019-11-02 19:36:19 +0100
commit6834e9cd6078109b32a4606710979a5b502903ed (patch)
tree81ebfd82214962d8cfe7a7d29ce656603b476c81 /net
parentce96d43cab1c757fd68ee6cfc19ad71c90c9e298 (diff)
downloadprosody-6834e9cd6078109b32a4606710979a5b502903ed.tar.gz
prosody-6834e9cd6078109b32a4606710979a5b502903ed.zip
net.resolvers: Abort on hostnames not passing IDNA validation
Prevents error on trying to use nil. Needs better error reporting in the future.
Diffstat (limited to 'net')
-rw-r--r--net/resolvers/basic.lua5
-rw-r--r--net/resolvers/service.lua5
2 files changed, 10 insertions, 0 deletions
diff --git a/net/resolvers/basic.lua b/net/resolvers/basic.lua
index d8031a6b..cafef58b 100644
--- a/net/resolvers/basic.lua
+++ b/net/resolvers/basic.lua
@@ -18,6 +18,11 @@ function methods:next(cb)
return;
end
+ if not self.hostname then
+ -- FIXME report IDNA error
+ cb(nil);
+ end
+
local targets = {};
local n = 2;
local function ready()
diff --git a/net/resolvers/service.lua b/net/resolvers/service.lua
index a76adb73..bb255c33 100644
--- a/net/resolvers/service.lua
+++ b/net/resolvers/service.lua
@@ -25,6 +25,11 @@ function methods:next(cb)
return;
end
+ if not self.hostname then
+ -- FIXME report IDNA error
+ cb(nil);
+ end
+
local targets = {};
local function ready()
self.targets = targets;