Skip to content

Commit

Permalink
LuaFAR (библиотека regex): падение при большом количестве captures (н…
Browse files Browse the repository at this point in the history
…есколько десятков) из-за отсутствовавшего вызова lua_checkstack.
  • Loading branch information
shmuz committed Mar 18, 2015
1 parent 31aa205 commit de9f7b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/luamacro/_globalinfo.lua
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
Version = { 1, 0, 0, 493 },
Version = { 1, 0, 0, 494 },
MinFarVersion = { 3, 0, 0, 4276 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
Expand Down
7 changes: 6 additions & 1 deletion plugins/luamacro/changelog
@@ -1,4 +1,9 @@
shmuel 17.03.2015 17:57:24 +0200 - build 493
shmuel 18.03.2015 20:34:15 +0200 - build 494

1. LuaFAR (библиотека regex): падение при большом количестве captures (несколько десятков) из-за
отсутствовавшего вызова lua_checkstack.

shmuel 17.03.2015 17:57:24 +0200 - build 493

1. С форума: Запуск lua: mf.postmacro(eval,"F1") приводит к ошибке "bad argument #1 to 'getfenv'
(invalid level)".
Expand Down
3 changes: 3 additions & 0 deletions plugins/luamacro/luafar/lregex.c
Expand Up @@ -194,6 +194,9 @@ int rx_find_match(lua_State *L, int op_find, int is_function, int is_wide)

skip = (op_find || data.Count>1) ? 1 : 0;

if (!lua_checkstack(L, (int)data.Count - skip))
luaL_error(L, "cannot add %d stack slots", (int)data.Count - skip);

for(i=skip; i<data.Count; i++)
{
if(data.Match[i].start >= 0 && data.Match[i].end >= data.Match[i].start)
Expand Down
2 changes: 1 addition & 1 deletion plugins/luamacro/luamacro.rc
@@ -1,6 +1,6 @@
#include <farversion.hpp>

#define PLUGIN_BUILD 493
#define PLUGIN_BUILD 494
#define PLUGIN_DESC "Lua Macros for Far Manager"
#define PLUGIN_NAME "LuaMacro"
#define PLUGIN_FILENAME "luamacro.dll"
Expand Down

0 comments on commit de9f7b6

Please sign in to comment.