shuffle and tweak for formatting.

pdf has very good page breaks now.
would be a good copy for fall 2009.
This commit is contained in:
Russ Cox 2009-08-08 01:07:30 -07:00
parent b3bebfce8a
commit 0aef891495
24 changed files with 6869 additions and 6672 deletions

6
exec.c
View file

@ -11,7 +11,7 @@ exec(char *path, char **argv)
{
char *mem, *s, *last;
int i, argc, arglen, len, off;
uint sz, sp, argp;
uint sz, sp, argp, x;
struct elfhdr elf;
struct inode *ip;
struct proghdr ph;
@ -67,7 +67,9 @@ exec(char *path, char **argv)
goto bad;
if(ph.type != ELF_PROG_LOAD)
continue;
if(ph.va + ph.memsz < ph.va || ph.va + ph.memsz > sz || ph.memsz < ph.filesz)
if(ph.va + ph.memsz < ph.va || ph.va + ph.memsz > sz)
goto bad;
if(ph.memsz < ph.filesz)
goto bad;
if(readi(ip, mem + ph.va, ph.offset, ph.filesz) != ph.filesz)
goto bad;