Skip to content

Fix the crash caused by out-of-bounds writes in survival mode (with lua)#109

Open
userwljs wants to merge 1 commit intoinfclass:kaffeine/survivalfrom
userwljs:pr/fix-survival-add-bot-write-out-of-bounds
Open

Fix the crash caused by out-of-bounds writes in survival mode (with lua)#109
userwljs wants to merge 1 commit intoinfclass:kaffeine/survivalfrom
userwljs:pr/fix-survival-add-bot-write-out-of-bounds

Conversation

@userwljs
Copy link

The bug manifests as follows: when a Witch is present and Lua is used, a rare SIGILL occurs in Debug builds, while SIGSEGV occurs frequently in Release builds.

pConf->BotConfigurations.Add(SurvivalBotConfiguration{.Class = PlayerClass});
and icArray::Add lack bounds checking. The CIcGameController::SurvivalAddBot method is frequently called by Lua and similarly lacks bounds checking. When the element count reaches MaxBotsPerWave (128), calling this method causes out-of-bounds writes.

@userwljs
Copy link
Author

userwljs commented Feb 7, 2026

Hi @Kaffeine,

If you have time, could you please take a look at this PR?

Thanks for your work on this project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant