aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-10-16 12:14:43 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-10-16 12:14:43 +0100
commit90d148b039be2d89a55dd3f3646dc6deb8f87208 (patch)
tree2529b41ae76f8e3edb8ce5b765e67a399ebf7d14 /src/lua
parent711b8dcb02936a6c769d922d0f0e800cb398b8a3 (diff)
downloadrspamd-90d148b039be2d89a55dd3f3646dc6deb8f87208.tar.gz
rspamd-90d148b039be2d89a55dd3f3646dc6deb8f87208.zip
[Minor] Check returned value
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
index 1ac69365a..fd3db0774 100644
--- a/src/lua/lua_util.c
+++ b/src/lua/lua_util.c
@@ -1501,7 +1501,13 @@ lua_util_glob (lua_State *L)
pattern = luaL_checkstring (L, i);
if (pattern) {
- glob (pattern, flags, NULL, &gl);
+ if (glob (pattern, flags, NULL, &gl) != 0) {
+ /* There is no way to return error here, so just create an table */
+ lua_createtable (L, 0, 0);
+ globfree (&gl);
+
+ return 1;
+ }
}
}