]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Parameters check: either config or task should be set 2439/head
authorMikhail Galanin <mgalanin@mimecast.com>
Thu, 23 Aug 2018 16:50:17 +0000 (17:50 +0100)
committerMikhail Galanin <mgalanin@mimecast.com>
Thu, 23 Aug 2018 16:50:17 +0000 (17:50 +0100)
src/lua/lua_http.c

index 3b00305064d8ecb510c8551b5fd26a0989779f9f..0c94969fa41c1380e210b7a95d902b9611825b6f 100644 (file)
@@ -815,6 +815,9 @@ lua_http_request (lua_State *L)
 
                return 1;
        }
+       if (task == NULL && cfg == NULL) {
+               return luaL_error (L, "Bad params to rspamd_http:request(): either task or config should be set");
+       }
 
        cbd = g_malloc0 (sizeof (*cbd));
        cbd->cbref = cbref;