gboolean validated = FALSE;
struct rspamd_map_helper_value *val;
- g_assert (in != NULL);
-
if (map == NULL || map->regexps == NULL || len == 0) {
return NULL;
}
+ g_assert (in != NULL);
+
if (map->map_flags & RSPAMD_REGEXP_MAP_FLAG_UTF) {
if (g_utf8_validate (in, len, NULL)) {
validated = TRUE;
raw = lua_toboolean (L, 3);
}
- if (data) {
+ if (data && len > 0) {
if (lua_gettop (L) >= 4) {
capture = TRUE;
captures = g_array_new (FALSE, TRUE,
raw = lua_toboolean (L, 3);
}
- if (data) {
+ if (data && len > 0) {
if (re->match_limit > 0) {
len = MIN (len, re->match_limit);
}
raw = lua_toboolean (L, 4);
}
- if (data) {
+ if (data && len > 0) {
matches = 0;
if (re->match_limit > 0) {
len = MIN (len, re->match_limit);
}
- if (data) {
+ if (data && len > 0) {
lua_newtable (L);
i = 0;
old_start = data;
+
while (rspamd_regexp_search (re->re, data, len, &start, &end, FALSE,
NULL)) {
if (start - old_start > 0) {