LBreakout2 2.6.5 crashes at startup: incorrect buffer size in gui/stk.c
Good-looking and addictive OpenSource games
Brought to you by:
kulkanie
On Arch Linux, LBreakout2 2.6.5-5 crashes at startup with *** buffer overflow detected ***.
I traced it to two calls to vsnprintf() in gui/stk.c. They use 511 - (path - ptr) for the remaining buffer size, but ptr points inside path, so the calculation goes the wrong way. In my crash, 537 bytes were passed for a buffer with only 486 bytes left.
Changing both calls to sizeof(path) - (ptr - path) fixes it. I rebuilt 2.6.5 with the attached patch and the game now starts normally.