Repository navigation
Conversation
…arsing Add test_encoding target in tests/common/ covering all detectCharset branches: - UTF-8 valid input with multibyte characters → UTF-8 - ESC $ B / ESC $ @ → ISO-2022-JP (JIS X 0208) - ESC $ A → ISO-2022-JP-2 (GB2312) - ESC $ ( C / ESC $ ( D → ISO-2022-JP-2 (KSC5601 / JIS X 0212) - ESC $ ) C → ISO-2022-KR (KSC5601) - ESC followed by non-$ → continues scanning - ESC $ followed by unknown char → falls back to default charset - NUL byte terminates scanning - Boundary conditions (commit 4a16a5d regression): empty array, truncated ESC / ESC $ / ESC $ ( / ESC $ ) sequences — verifies no heap buffer overread (CWE-125) 22 test cases, all passing. Log: 补充 detectCharset ESC 序列解析及边界条件的 GTest 单元测试
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideTestsAdd GTest coverage for detectCharset’s UTF-8 and ESC-sequence branches, fallback behavior, and truncated-input boundaries, and register the test target so these checks can be built and run.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 6.6.13 |
补充 detectCharset 单元测试
关联提交: 4a16a5d fix(encodes): fix heap buffer overflow read in detectCharset (CWE-125)
测试覆盖
新增
tests/common/test_encoding.cpp,22 个 GTest 用例覆盖detectCharset全部分支:\xC3\xA9(é)\xE4\xB8\xAD(中)本地验证
变更文件
tests/common/test_encoding.cpp(新增)tests/common/CMakeLists.txt(APPEND test_encoding target)Summary by Sourcery
Add comprehensive unit tests for charset detection, including ESC sequence parsing and truncated-input safety regressions.
Enhancements:
Build:
Tests: