Description
Area(s) with this issue?
This is a development issue
Describe the issue
I found a scenario that causes a crash after upgrading to C++20 in MSVC32, which does not occur in the retail version or when building with VC6. During game load, the game reads the mapchache.ini
file that contains player map details. Normally, the game can ignore invalid maps, but there are maps with unusual characters in their names that cause a crash in MSVC32.
Example map name:
The map name contains the \uA0
character:
AOD relinquish\uA0by vatscove [pashacnc com].tga
The crash occurs specifically in the AsciiStringToQuotedPrintable
function when trying to call isalnum(*src)
on a character that is not valid. When the game tries to load a map with a name containing the character \uA0
, it crashes with the following error:
Debug Assertion Failed!
Program: ... version\Command & Conquer Generals - Zero Hour\generalszh.exe
File: minkernel\crts\ucrt\src\appcrt\convert\isctype.cpp
Line: 36
Expression: c >= -1 && c <= 255
Expected Behavior:
The game should handle invalid or malformed map names without crashing, as it did in previous versions (VC6 and retail version). The AsciiStringToQuotedPrintable
function should handle non-alphanumeric characters correctly and avoid crashing when encountering invalid characters.
In VC6 the game manages to load the map and display it.
Steps to reproduce
- Download the map and place it in the maps directory. Direct Link
- Run the game in Debug mode using MSVC32 (including the C++20 upgrade from PR [ZH] Make Zero Hour game compile with VS2022 c++20 #426).
Attachments
No response