Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
truename: fix array overrun (pick from fdpp)
Picked from the commit at dosemu2/fdpp@fe1c4dc The referenced issue is at dosemu2/fdpp#212 The patch was applied using unix2dos on the patch file then `patch -p1 --binary` with the patch file as stdin. The original used a new define for the maximum path length. As there is no difference to our current SFTMAX define I changed this hunk to retain the SFTMAX use. This fixes a bug when eg function 3Dh receives a buffer that starts with ".\" but the byte in memory before this buffer happens to be also a dot. I ran into this problem semi-randomly during building EDR-DOS with the most recent WarpLink build. If WarpLink was placed somewhat low in the Low Memory Area then one of its function 3Dh calls would happen to have a dot before the pathname buffer. (I had to load lCDebug using the last fit strategy then enter TSR mode, to catch the bug without the presence of the debugger working around the occurrence of the bug.) Original commit Metadata: From: Stas Sergeev <[email protected]> Date: Wed, 1 Feb 2023 13:01:55 +0500 Subject: [PATCH] truename: fix array overrun [fixes #212] src[-2] was peeking into a random memory location. It seems entire truename() is written by some morons... :( Its completely unreadable and full of bugs.
- Loading branch information