kernel: fix args crossing page boundaries in sysexec

Should also fix CID 155615 (Operands don't affect result)
This commit is contained in:
Giacomo Tesio 2017-08-14 19:25:49 +02:00
parent df8bc2ce43
commit 180da90a06
1 changed files with 1 additions and 1 deletions

View File

@ -400,7 +400,7 @@ sysexec(char* p, char **argv)
argsize += sizeof(uintptr_t); /* place for argc = nil */
tmp = up->seg[ESEG]->top - argsize;
if(tmp&~(PGSZ-1) != (tmp+sizeof(uintptr_t)+sizeof(char*)*(argc+1))&~(PGSZ-1)){
if((tmp&~(PGSZ-1)) != ((tmp+sizeof(uintptr_t)+sizeof(char*)*(argc+1))&~(PGSZ-1))){
/* the argument pointers cross a page boundary, keep
* them all in the same page
*/