add check for wrapping of address + size in exec()
This commit is contained in:
parent
67a7f9597e
commit
5625ae4973
1 changed files with 2 additions and 0 deletions
2
exec.c
2
exec.c
|
@ -44,6 +44,8 @@ exec(char *path, char **argv)
|
|||
continue;
|
||||
if(ph.memsz < ph.filesz)
|
||||
goto bad;
|
||||
if(ph.vaddr + ph.memsz < ph.vaddr)
|
||||
goto bad;
|
||||
if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
|
||||
goto bad;
|
||||
if(ph.vaddr % PGSIZE != 0)
|
||||
|
|
Loading…
Reference in a new issue