The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: ceeac on May 03, 2020, 03:20:35 PM

Title: Fix for potential crash when opening gameinfo window
Post by: ceeac on May 03, 2020, 03:20:35 PM
This fixes a potential crash when opening the game info window via the "play online" button. If the language iso is for example only 2 characters, the memcpy call copies more characters than needed.
Title: Re: Fix for potential crash when opening gameinfo window
Post by: prissi on May 05, 2020, 03:08:03 AM
Simutrans cannot handle language codes larger than 2 letters with the current system anyway, also limited by the translator. Moreover, if you do a malloc, the smallest chunk you can get (typically) is 256 bytes, hence this error should not occur.

Nevertheless, using tstrncpy is indeed better. In in r9064.