From: Alan Cox Date: Sat, 27 Dec 2014 12:51:41 +0000 (+0000) Subject: execve: Fix ABI change on unsized binaries X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=14671e3293a6e753f68e41bf09d384b3de202381;p=FUZIX.git execve: Fix ABI change on unsized binaries We need to adjust by the load page *after* we have checked for zero. --- diff --git a/Kernel/syscall_exec.c b/Kernel/syscall_exec.c index c25175a2..a9257903 100644 --- a/Kernel/syscall_exec.c +++ b/Kernel/syscall_exec.c @@ -76,9 +76,11 @@ int16_t _execve(void) * UZI binaries). */ if (buf[3] == 'F' && buf[4] == 'Z' && buf[5] == 'X' && buf[6] == '1') { - top = buf[8] | ((unsigned int)buf[9] << 8) - PROGLOAD; + top = buf[8] | ((unsigned int)buf[9] << 8); if (top == 0) /* Legacy 'all space' binary */ top = ramtop; + else /* Requested an amount, so adjust for the base */ + top += PROGLOAD; emu_ino = 0; // no emulation, thanks /* Don't load binaries for the wrong base page, eg spectrum binaries on a sane box */