tests: guard botlib bounded string regressions#152
Conversation
Co-authored-by: Tim Fox <timfox@outlook.com>
…d_strings + README Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Stale comment
Security review complete: no medium-or-higher confidence vulnerabilities found in the added/modified code.
Scope reviewed: new CTest wiring,
tests/README.md, andtests/scripts/test_botlib_bounded_strings.sh. The new script reads fixed repository source files and checks bounded string invariants; I did not find an attacker-controlled path to injection, authz bypass, secret exposure, unsafe deserialization, path traversal, or other security sink. No prior automation review threads were present to re-report.Sent by Cursor Automation: Find vulnerabilities
There was a problem hiding this comment.
Security review complete: no medium-or-higher confidence vulnerabilities found in the added or modified code.
Scope reviewed: new CTest wiring in CMakeLists.txt, tests/README.md, and tests/scripts/test_botlib_bounded_strings.sh. The executable change is a local regression checker that reads fixed repository source files and uses quoted paths into inline Python; I did not find an attacker-controlled path to injection, authz bypass, secret exposure, SSRF, path traversal, unsafe deserialization, or another security sink.
Validation: tests/scripts/test_botlib_bounded_strings.sh passed locally. No prior review threads were present to re-report.
Sent by Cursor Automation: Find vulnerabilities


Summary
tests/README.md.Risky behavior now covered
BotLoadChatMessagemust keep length preflight checks and boundedQ_strncpyz/Com_sprintfwrites for fixed strings, numeric variables, and random string references.SourceError/SourceWarningmust keep boundedQ_vsnprintfformatting.#eval/$evalparser token formatting must keep boundedCom_sprintf(token.string, MAX_TOKEN, ...)calls.Test files added/updated
tests/scripts/test_botlib_bounded_strings.shCMakeLists.txttests/README.mdWhy this reduces regression risk
These botlib parser/chat paths consume script/chat data and exist in duplicated platform trees, so reverting to unbounded formatting or drifting one platform copy would create memory-safety risk with broad engine impact. The new source-level regression test is fast, deterministic, and checks both copies for the specific bounded APIs and size guards introduced by the recent audit work.
Validation
tests/scripts/test_botlib_bounded_strings.shcmake -S . -B build-coverage-tests -DBUILD_UNIT_TESTS=OFF -DBUILD_EXAMPLE_DEMO_GAME=OFFctest --test-dir build-coverage-tests -R test_botlib_bounded_strings --output-on-failure