diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-07-01 16:40:28 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-07-01 16:40:28 +0400 |
commit | 83cc70ff18209116bd486b4932f206dd5a3fd83f (patch) | |
tree | ad6693561e07d373d08ca40eae36dd622b5a2795 /src/map.c | |
parent | 0f7464cc19e85b0200d7a59f3eb0a93efdcc6ce7 (diff) | |
download | rspamd-83cc70ff18209116bd486b4932f206dd5a3fd83f.tar.gz rspamd-83cc70ff18209116bd486b4932f206dd5a3fd83f.zip |
* Fix stupid bug in calculating buffer length while reading file maps
Diffstat (limited to 'src/map.c')
-rw-r--r-- | src/map.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -386,8 +386,9 @@ read_map_file (struct rspamd_map *map, struct file_map_data *data) rlen = 0; while ((r = read (fd, buf + rlen, sizeof (buf) - rlen - 1)) > 0) { - buf[r++] = '\0'; - remain = map->read_callback (map->pool, buf, r - 1, &cbdata); + r += rlen; + buf[r] = '\0'; + remain = map->read_callback (map->pool, buf, r, &cbdata); if (remain != NULL) { /* copy remaining buffer to start of buffer */ rlen = r - (remain - buf); |