Closed erasmux closed 6 years ago
I probably know where this is happening. I can look into solving it later.
I have fixed this on my private build. Will make a pull request soon.
Merged and I think fixed? Going to close this. If for some reason it isn't fixed we can reopen.
When investigating a LOOT 0.12 crash with the latest developmental build (MO 2.1 build 2/12/2017), I stumbled upon two bugs. I will start with a test scenario which demonstrates the more severe bug IMHO. After that I will detail why MO2 + long paths are causing ungraceful termination of the running process.
A test case which reproduces the problem for me:
readmes\.bla\hello.txt
Data\readmes
with MO2 (I did this by running FreeCommander). The problem is thatData\readmes\.bla
points back toData\readmes
, so you can reach paths like:Data\readmes\.bla\.bla\.bla\.bla\.bla\.bla\.bla\.bla\.bla\.bla\.bla\.bla\.bla\.bla
and if a program will try to recurse the directory structure it will likely cause a crash (more on this later). Another side of effect of this is thathello.txt
appears underData\readmes
. I think MO2 is interpreting.bla
as.
.Oddly enough, depending on the directory structure, I don't always see the
.bla
directory. For example if I put.bla
directly underData
or usedocs
instead ofreadmes
in the above example I don't see the.bla
folder at all. Thehello.txt
will still appear in the parent folder.I stumbled upon this bug because I managed to get a
.vs
folder added to the FNIS tools folder (when I let VS debug unrelated crashes MO2 is causing in FNIS...). This caused LOOT 0.12 with MO2 to terminate in the following manner:The problem is that strcpy_s is called with a source string which is larger than the destination size of 260 bytes. The source string is:
IMHO strcpy_s is an evil function because when the destination is too small it terminates your program in a very ungraceful manner. Usually the strncpy_s with _TRUNCATE is what you actually want.