revision 72:ceb5985fa8d8
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 72:ceb5985fa8d8 |
parent | 71:fcde57dbf968 |
child | 73:0bb57e51ac9e |
author | nkeynes |
date | Tue Jan 10 14:00:00 2006 +0000 (17 years ago) |
Limit block loads to file size
1.1 --- a/src/mem.c Tue Jan 10 13:59:35 2006 +00001.2 +++ b/src/mem.c Tue Jan 10 14:00:00 2006 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: mem.c,v 1.10 2005-12-28 22:47:44 nkeynes Exp $1.6 + * $Id: mem.c,v 1.11 2006-01-10 14:00:00 nkeynes Exp $1.7 * mem.c is responsible for creating and maintaining the overall system memory1.8 * map, as visible from the SH4 processor.1.9 *1.10 @@ -200,7 +200,7 @@1.11 if( f == NULL )1.12 return errno;1.13 fstat( fileno(f), &st );1.14 - if( length == 0 || length == -1 )1.15 + if( length == 0 || length == -1 || length > st.st_size )1.16 length = st.st_size;1.18 while( total < length ) {
.