aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-03 10:18:17 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-03 10:18:17 +0100
commita24b1306ff804c375ebca37bde889831afe6455b (patch)
treeb3e4f43e00c668c70b68c5f4903961c2cb6af55c /src
parentc6cd45c26336fa55e25d499324b54dd58911e3a6 (diff)
downloadrspamd-a24b1306ff804c375ebca37bde889831afe6455b.tar.gz
rspamd-a24b1306ff804c375ebca37bde889831afe6455b.zip
Do not accept zero sized maps.
Diffstat (limited to 'src')
-rw-r--r--src/libutil/map.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c
index 5161871dc..20c7d0e4c 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