xv6

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 90bab90832d1f3863d8345bcc2a2e5f59c270af8
parent f3685aa391431d5eafbc918e1d143dd731c64787
Author: rsc <rsc>
Date:   Sun, 31 May 2009 02:11:27 +0000

exec sanity check

Diffstat:
Mexec.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exec.c b/exec.c @@ -62,7 +62,7 @@ exec(char *path, char **argv) goto bad; if(ph.type != ELF_PROG_LOAD) continue; - if(ph.va + ph.memsz > sz) + if(ph.va + ph.memsz < ph.va || ph.va + ph.memsz > sz || ph.memsz < ph.filesz) goto bad; if(readi(ip, mem + ph.va, ph.offset, ph.filesz) != ph.filesz) goto bad;