From: Vsevolod Stakhov Date: Wed, 3 Aug 2016 09:17:18 +0000 (+0100) Subject: [Minor] Do not abort on empty input for regexp maps X-Git-Tag: 1.3.2~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35857310cf1b5bcdc579afe1cc36ee6c4c0f15ef;p=thirdparty%2Frspamd.git [Minor] Do not abort on empty input for regexp maps --- diff --git a/src/libutil/map.c b/src/libutil/map.c index 72d0e45be6..b3bb8dc2ce 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;