From: Alan Cox Date: Tue, 26 Sep 2017 13:00:23 +0000 (+0100) Subject: execve: note a thing to check, do a spot tidy X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=d57938c60667db639f286765e6386ed45912b095;p=FUZIX.git execve: note a thing to check, do a spot tidy --- diff --git a/Kernel/syscall_exec16.c b/Kernel/syscall_exec16.c index 46f7a296..0e9d8060 100644 --- a/Kernel/syscall_exec16.c +++ b/Kernel/syscall_exec16.c @@ -81,8 +81,6 @@ static int header_ok(uint8_t *pp) p += 3; if (*p++ != 'F' || *p++ != 'Z' || *p++ != 'X' || *p++ != '1') return 0; -// if (*p && *p != (PROGLOAD >> 8)) -// return 0; return 1; } @@ -137,7 +135,7 @@ arg_t _execve(void) } progload = (*(uint8_t *)(buf + 7)) << 8; - if ( ! progload ) + if (progload == 0) progload = PROGLOAD; top = *(uint16_t *)(buf + 8); @@ -149,6 +147,7 @@ arg_t _execve(void) bss = *(uint16_t *)(buf + 14); /* Binary doesn't fit */ + /* FIXME: review overflows */ bin_size = ino->c_node.i_size; progptr = bin_size + 1024 + bss; if (top - progload < progptr || progptr < bin_size) {