diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-17 00:15:23 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-17 00:15:23 +0000 |
commit | f7a0e556cdc4df8488e48fc8df0eec706b67ed17 (patch) | |
tree | a8c78244efa026cee7a11c7c9ea961b79c31bec9 /src/lua | |
parent | 601bcf0e76ffd31291f21d99e7f8d4ca969b0791 (diff) | |
download | rspamd-f7a0e556cdc4df8488e48fc8df0eec706b67ed17.tar.gz rspamd-f7a0e556cdc4df8488e48fc8df0eec706b67ed17.zip |
Fix regexp creating from // pattern.
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_regexp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua/lua_regexp.c b/src/lua/lua_regexp.c index 0d95fee9c..1b8702d1f 100644 --- a/src/lua/lua_regexp.c +++ b/src/lua/lua_regexp.c @@ -115,8 +115,8 @@ lua_regexp_create (lua_State *L) slash = strrchr (string, '/'); if (slash != NULL && slash != string) { flags_str = slash + 1; - pattern = g_malloc (slash - string - 1); - rspamd_strlcpy (pattern, string + 1, slash - string - 1); + pattern = g_malloc (slash - string); + rspamd_strlcpy (pattern, string + 1, slash - string); } else { pattern = g_strdup (string); |