From: Vsevolod Stakhov Date: Tue, 17 Feb 2015 00:15:23 +0000 (+0000) Subject: Fix regexp creating from // pattern. X-Git-Tag: 0.9.0~683 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f7a0e556cdc4df8488e48fc8df0eec706b67ed17;p=thirdparty%2Frspamd.git Fix regexp creating from // pattern. --- 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);