ToME always crashes when the player wants to save and has a background story that is too long. Reproducible: Always Steps to Reproduce: 1. Start tome 2. Generate a character of any class with a background story longer than 80 characters (especially, the auto-generated descriptions typically will be longer). 3. Start the game. 4. Save the game (^X). Actual Results: Game crashed with this terminal output: *** buffer overflow detected ***: tome - terminated tome: buffer overflow attack in function <unknown> - terminated Report to http://bugs.gentoo.org/ Expected Results: Successful save and no crash. I recompiled and ran the program through valgrind, which showed that the buffer overflow occured in src/loadsave.c (do_extra). Quick code examination suggested that character descriptions longer than 79 characters may not work, descriptions longer than 80 characters may cause the observed buffer overflow. Unfortunately, the default descriptions are already longer than 80 characters, typically, causing the game to crash on save for most players.
Created attachment 224385 [details] Enlarge the buffer in question. This patch seems to fix the problem for default background stories. Problem will reappear with background stories exceeding 1kb.
Created attachment 224387 [details, diff] Apply the buffer overflow patch.
Hopefully that bug is now fixed. I did not apply your changes as I imagine it changes the format of the saved files. I saw the patch on the 3.0 version and they fixed using strncpy instead of strcpy. I just did fix the ./lib/edit/p_info.txt reducing the size of the longest string to 80 chars. It seems to work. Thanks however for report and analysis and reopen it if you see the same behaviour again.