]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Check returned value
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 16 Oct 2021 11:14:43 +0000 (12:14 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 16 Oct 2021 11:14:43 +0000 (12:14 +0100)
src/lua/lua_util.c

index 1ac69365a43faec4d7bc017f8f6d65a96da703ae..fd3db07749afaab2474e7c6f002e6fa445b681c7 100644 (file)
@@ -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;
+                       }
                }
        }