]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Fix regexp creating from // pattern.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Feb 2015 00:15:23 +0000 (00:15 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Feb 2015 00:15:23 +0000 (00:15 +0000)
src/lua/lua_regexp.c

index 0d95fee9c67ae1f1a251b3e764a45480170a093e..1b8702d1fb5678c14f724bda2e8e348fa385b7f6 100644 (file)
@@ -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);