Search
lxdream.org :: lxdream :: r1117:0b14a8ec373b
lxdream 0.9.1
released Jun 29
Download Now
changeset1117:0b14a8ec373b
parent1116:09a69dfc7931
child1118:0c00e6594d01
authornkeynes
dateWed Sep 08 17:24:16 2010 +1000 (13 years ago)
Fix wrapped cdrom ELF images (writing to wild memory, natch)
src/loader.c
1.1 --- a/src/loader.c Wed Sep 08 08:43:15 2010 +1000
1.2 +++ b/src/loader.c Wed Sep 08 17:24:16 2010 +1000
1.3 @@ -442,7 +442,7 @@
1.4 if( phdr[i].p_type == PT_LOAD ) {
1.5 lseek( fd, phdr[i].p_offset, SEEK_SET );
1.6 uint32_t size = MIN( phdr[i].p_filesz, phdr[i].p_memsz);
1.7 - int status = read( fd, program + phdr[i].p_vaddr, size );
1.8 + int status = read( fd, program + phdr[i].p_vaddr - start, size );
1.9 if( status == -1 ) {
1.10 SET_ERROR( err, LX_ERR_FILE_IOERROR, "I/O error reading SH4 binary %s (%s)", filename, strerror(errno) );
1.11 } else if( status != size ) {
.