2026-01-25
This week a little work happened. The MCP and CLU also got alternative backronyms to describe what they do: Multiple Command Payload and Comspec Load Utility.
bx - pathname gives the full length - the spurious +1 was under the assumption that bx pointed at the NUL. In practice this could truncate the environment or corrupt the name of the next environment variable.In the exec.nas source text file, add a comment on the MZ .exe image read loop. In particular, if the file is >= 512 bytes short for the given exePages size, the exec call errors out. exeExtraBytes is never read. Due to the choice of boundaries for the loop, a non-last read being 1 to 511 bytes short will always lead to the subsequent read to be at least 512 bytes short, so the desired invariant is upheld.
I suspected that there may be a bug in this loop because I reviewed it for the report to the repo of "the list", in which I suggested possible additions to the interrupt list.
In the forum, I asked what happens if a DOS extender changes the PSP environment word from a segment to a selector, and then an exec runs with a zero-value for the source environment. Two replies by tkchia indicate the DOS extender will simply handle the exec as well, so it can intercept attempts to run exec that would read from the PSP.