Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Game crash with russian locale #133

Closed
nwtour opened this issue Mar 30, 2019 · 1 comment
Closed

Game crash with russian locale #133

nwtour opened this issue Mar 30, 2019 · 1 comment

Comments

@nwtour
Copy link

nwtour commented Mar 30, 2019

Crash if in system russian (or any non latin) locale:
$ locale
LANG=ru_RU.UTF-8
$ /usr/local/bin/7kaa
*** buffer overflow detected ***: /usr/local/bin/7kaa terminated

GDB:
Program received signal SIGABRT, Aborted.
0xb7a23a50 in raise () from /lib/libc.so.6
(gdb) bt
#0 0xb7a23a50 in raise () from /lib/libc.so.6
#1 0xb7a24ef7 in abort () from /lib/libc.so.6
#2 0xb7a5e8e4 in ?? () from /lib/libc.so.6
#3 0xb7ad9a12 in __fortify_fail () from /lib/libc.so.6
#4 0xb7ad7c48 in __chk_fail () from /lib/libc.so.6
#5 0xb7ad723f in __strcpy_chk () from /lib/libc.so.6
#6 0x08068c65 in strcpy (__src=, __dest=0x820171c <config+60> "") at /usr/include/bits/string3.h:110
#7 Config::default_local_game_setting (this=0x82016e0 ) at OCONFIG.cpp:152
#8 0x08069539 in Config::init (this=0x82016e0 ) at OCONFIG.cpp:61
#9 0x0804be1a in main (argc=1, argv=0xbffff7d4) at AM.cpp:314

Crash on code: strcpy(player_name, _("New Player"));
"New player" translated as "Новый Игрок" (11 symbols its size 22 in UTF8 locale, but for "player_name" reserved size 20 bytes)

@the3dfxdude
Copy link
Owner

Fixed by 86a181d

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants