Skip to content

[HL][TFC] Crash while parsing command menu (menu item length) #3956

@pizzahut2

Description

@pizzahut2

Not related to #1730 apart from that it also happens in the command menu.

There have been reports by French TFC players experiencing a crash when trying to join a server, with the proposed work-around being to delete the "tfc_french" folder. I tried to reproduce the crash and find out what's causing it, with success.

It seems to be HL25 specific, so not happening when using the steam_legacy branch.

Quoting myself:

I fixed the "tfc_french" folder. The culprit was the "commandmenu.txt". There is a bug in the current version of TFC which causes it to crash if a menu item is longer than 31 characters. The old version of TFC (steam_legacy) is not affected. So this is a bug introduced with the 25th anniversary update of Half-Life.

On a side note, the French command menu file uses ANSI instead of UTF-8. Diacritics show up, so I guess it's not an issue.

Related discussion: https://steamcommunity.com/app/20/discussions/0/601891815092683482/

Diff: french_commandmenu.diff.txt
I only removed the single quotes to fit more letters into the maximum of 31 characters. The command string can be longer.

Test case 1
"8" "You finish building the dispenser." "say OK"
A buffer overflow occurs if the original string is too long in the button text.

Test case 2
"8" "#Dispenser_finish" "say OK"
A buffer overflow occurs if the substituted string is too long in the button text.

These are triggered in two different code segments of "CHudTextMessage::LocaliseTextString" in "cl_dll/text_message.cpp".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions