From f7a0e556cdc4df8488e48fc8df0eec706b67ed17 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 17 Feb 2015 00:15:23 +0000 Subject: [PATCH] Fix regexp creating from // pattern. --- src/lua/lua_regexp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua/lua_regexp.c b/src/lua/lua_regexp.c index 0d95fee9c6..1b8702d1fb 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); -- 2.47.3