xash3d-fwgs icon indicating copy to clipboard operation
xash3d-fwgs copied to clipboard

Crash on updating Con_LoadHistory method

Open adslbarxatov opened this issue 2 months ago • 0 comments

Hi!

We've found a breach in new version of Con_LoadHistory method. We've attached the console_history file created by previous version (March 2024) of the engine. It has some obvious miswritings (multiple 0x0D characters). Older version of the engine was able to parse this file without crashes. The new version of the engine (May 2024) makes no miswritings and works fine if you clear the console history.

But if we using this file the method causes a memory access violation (with non-sense address) somewhere outside the engine assemblies (we can't precisely locale it using Visual studio and complete PDB's for all DLLs). We only found out that the crash comes from the FS_Gets method on the second iteration of the cycle inside the Con_LoadHistory. But if you using step-by-step debug mode (F10 / F11), the method finishes without a crash. Like it somehow depends on the speed of the execution.

Hope, our little investigation will help you to workaround this case and create a safe patch. Because we can't understand how to do that for now.

Best regards, Nicolay B.

console_history

console_history.txt

adslbarxatov avatar May 09 '24 05:05 adslbarxatov