From: Vsevolod Stakhov Date: Sat, 16 Oct 2021 11:14:43 +0000 (+0100) Subject: [Minor] Check returned value X-Git-Tag: 3.1~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90d148b039be2d89a55dd3f3646dc6deb8f87208;p=thirdparty%2Frspamd.git [Minor] Check returned value --- diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c index 1ac69365a4..fd3db07749 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; + } } }