]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not abort on empty input for regexp maps
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 3 Aug 2016 09:17:18 +0000 (10:17 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 3 Aug 2016 09:17:18 +0000 (10:17 +0100)
src/libutil/map.c

index 72d0e45be6fd2fced9d32ee72250d96c2e92bbf0..b3bb8dc2ce61476dd5d6e9d9e0e63aa713c0b97f 100644 (file)
@@ -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;