From: Vsevolod Stakhov Date: Sun, 3 May 2015 09:18:17 +0000 (+0100) Subject: Do not accept zero sized maps. X-Git-Tag: 0.9.0~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a24b1306ff804c375ebca37bde889831afe6455b;p=thirdparty%2Frspamd.git Do not accept zero sized maps. --- diff --git a/src/libutil/map.c b/src/libutil/map.c index 5161871dc9..20c7d0e4ce 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -193,7 +193,7 @@ http_map_read (struct rspamd_http_connection *conn, gchar *pos; struct rspamd_map *map; - if (msg->code != 200) { + if (msg->code != 200 || len == 0) { /* Ignore not full replies */ return 0; } @@ -269,8 +269,10 @@ read_map_file (struct rspamd_map *map, struct file_map_data *data) close (fd); - map->fin_callback (map->pool, &cbdata); - *map->user_data = cbdata.cur_data; + if (rlen > 0) { + map->fin_callback (map->pool, &cbdata); + *map->user_data = cbdata.cur_data; + } } static void