diff options
-rw-r--r-- | backends/dc/dcloader.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/backends/dc/dcloader.cpp b/backends/dc/dcloader.cpp index 17c13ceb74..04ad4ba003 100644 --- a/backends/dc/dcloader.cpp +++ b/backends/dc/dcloader.cpp @@ -226,6 +226,9 @@ bool DLObject::load(int fd) DBG("segment @ %p\n", segment); + if(phdr.p_memsz > phdr.p_filesz) + memset(((char *)segment) + phdr.p_filesz, 0, phdr.p_memsz - phdr.p_filesz); + if(lseek(fd, phdr.p_offset, SEEK_SET)<0 || read(fd, segment, phdr.p_filesz) != phdr.p_filesz) { seterror("Segment load failed."); |