diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-03 10:17:18 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-03 10:17:18 +0100 |
commit | 35857310cf1b5bcdc579afe1cc36ee6c4c0f15ef (patch) | |
tree | 1d5ee2ba1cc1a613e74608c964317fd83ac2af81 /src/libutil/map.c | |
parent | 0ef106e8a3a39c3dbd8e2cc5f24fff7e0e23ac40 (diff) | |
download | rspamd-35857310cf1b5bcdc579afe1cc36ee6c4c0f15ef.tar.gz rspamd-35857310cf1b5bcdc579afe1cc36ee6c4c0f15ef.zip |
[Minor] Do not abort on empty input for regexp maps
Diffstat (limited to 'src/libutil/map.c')
-rw-r--r-- | src/libutil/map.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c index 72d0e45be..b3bb8dc2c 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -2176,13 +2176,12 @@ rspamd_match_regexp_map (struct rspamd_regexp_map *map, gpointer ret = NULL; gboolean validated = FALSE; - g_assert (in != NULL && len > 0); + g_assert (in != NULL); - if (map == NULL) { + if (map == NULL || len == 0) { return NULL; } - if (map->has_utf) { if (g_utf8_validate (in, len, NULL)) { validated = TRUE; |