Browse code

bb#2306

aCaB authored on 2010/10/14 23:16:15
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Oct 14 16:14:01 CEST 2010 (acab)
2
+------------------------------------
3
+ * libclamav/fmap.c: properly check for pread errors (bb#2306)
4
+
1 5
 Thu Oct 14 16:06:06 CEST 2010 (acab)
2 6
 ------------------------------------
3 7
  * clamd: properly terminate zSTATS (bb#2286)
... ...
@@ -207,7 +207,7 @@ static void fmap_aging(fmap_t *m) {
207 207
 
208 208
 
209 209
 static int fmap_readpage(fmap_t *m, unsigned int first_page, unsigned int count, unsigned int lock_count) {
210
-    size_t readsz = 0, eintr_off, got;
210
+    size_t readsz = 0, eintr_off;
211 211
     char *pptr = NULL, err[256];
212 212
     uint32_t s;
213 213
     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,
277 277
 
278 278
 	    eintr_off = 0;
279 279
 	    while(readsz) {
280
+		ssize_t got;
280 281
 		got=pread(m->fd, pptr, readsz, eintr_off + m->offset + first_page * m->pgsz);
281 282
 
282 283
 		if(got < 0 && errno == EINTR)