diff --git a/ChangeLog b/ChangeLog index 7791b5cfd..49554ba49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Oct 14 16:14:01 CEST 2010 (acab) +------------------------------------ + * libclamav/fmap.c: properly check for pread errors (bb#2306) + Thu Oct 14 16:06:06 CEST 2010 (acab) ------------------------------------ * clamd: properly terminate zSTATS (bb#2286) diff --git a/libclamav/fmap.c b/libclamav/fmap.c index 61aeb6e8c..2c964edca 100644 --- a/libclamav/fmap.c +++ b/libclamav/fmap.c @@ -207,7 +207,7 @@ static void fmap_aging(fmap_t *m) { static int fmap_readpage(fmap_t *m, unsigned int first_page, unsigned int count, unsigned int lock_count) { - size_t readsz = 0, eintr_off, got; + size_t readsz = 0, eintr_off; char *pptr = NULL, err[256]; uint32_t s; unsigned int i, page = first_page, force_read = 0; @@ -277,6 +277,7 @@ static int fmap_readpage(fmap_t *m, unsigned int first_page, unsigned int count, eintr_off = 0; while(readsz) { + ssize_t got; got=pread(m->fd, pptr, readsz, eintr_off + m->offset + first_page * m->pgsz); if(got < 0 && errno == EINTR)