aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-09 18:02:29 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-09 18:02:29 +0100
commita34711685b3d17a1e3ec9f3d5069096522ba2a35 (patch)
treef7a11a759f5e6a190a1db14f1fc6486de4cb5576 /src
parent3a3f36fa5ec1d9a08cc0365dcafc5dc5d2cc7d08 (diff)
downloadrspamd-a34711685b3d17a1e3ec9f3d5069096522ba2a35.tar.gz
rspamd-a34711685b3d17a1e3ec9f3d5069096522ba2a35.zip
Check DNS resolver return value.
Diffstat (limited to 'src')
-rw-r--r--src/lua/lua_http.c9
-rw-r--r--src/lua/lua_tcp.c7
2 files changed, 12 insertions, 4 deletions
diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c
index cec631402..10b108f13 100644
--- a/src/lua/lua_http.c
+++ b/src/lua/lua_http.c
@@ -454,8 +454,13 @@ lua_http_request (lua_State *L)
}
}
else {
- make_dns_request (resolver, session, NULL, lua_http_dns_handler, cbd,
- RDNS_REQUEST_A, msg->host->str);
+ if (!make_dns_request (resolver, session, NULL, lua_http_dns_handler, cbd,
+ RDNS_REQUEST_A, msg->host->str)) {
+ lua_http_maybe_free (cbd);
+ lua_pushboolean (L, FALSE);
+
+ return 1;
+ }
}
lua_pushboolean (L, TRUE);
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c
index fadb7d93b..43e8cab7e 100644
--- a/src/lua/lua_tcp.c
+++ b/src/lua/lua_tcp.c
@@ -610,8 +610,11 @@ lua_tcp_request (lua_State *L)
}
}
else {
- make_dns_request (resolver, session, NULL, lua_tcp_dns_handler, cbd,
- RDNS_REQUEST_A, host);
+ if (!make_dns_request (resolver, session, NULL, lua_tcp_dns_handler, cbd,
+ RDNS_REQUEST_A, host)) {
+ lua_tcp_push_error (cbd, "cannot resolve host");
+ lua_tcp_maybe_free (cbd);
+ }
}
lua_pushboolean (L, TRUE);