From: Vsevolod Stakhov Date: Tue, 17 Feb 2015 13:44:51 +0000 (+0000) Subject: Stop regexp flags parsing on the first bad flag. X-Git-Tag: 0.9.0~677 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f775918665f0313bbeb8f53bafd7e8aa1146e011;p=rspamd.git Stop regexp flags parsing on the first bad flag. --- diff --git a/src/lua/lua_regexp.c b/src/lua/lua_regexp.c index 1b8702d1f..a86424c66 100644 --- a/src/lua/lua_regexp.c +++ b/src/lua/lua_regexp.c @@ -152,12 +152,13 @@ lua_regexp_create (lua_State *L) break; default: msg_info ("invalid regexp flag: %c", *flags_str); + goto fin; break; } flags_str++; } } - +fin: re = g_regex_new (pattern, regexp_flags, 0, &err); if (re == NULL) { g_free (pattern);