Skip to content

fix: correct timeStrCache calculation to exclude unmatched trailing chars#2557

Open
Snssn wants to merge 1 commit into
alibaba:mainfrom
Snssn:main
Open

fix: correct timeStrCache calculation to exclude unmatched trailing chars#2557
Snssn wants to merge 1 commit into
alibaba:mainfrom
Snssn:main

Conversation

@Snssn
Copy link
Copy Markdown

@Snssn Snssn commented May 6, 2026

Use strptimeResult position (actual matched end) instead of curTimeStr.length()
when building the second-level cache. This fixes cache pollution when the time
string contains trailing characters not matched by the format string (e.g. timezone suffix +08:00)

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


senyong.wang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

…hars

Use strptimeResult position (actual matched end) instead of curTimeStr.length()
when building the second-level cache. This fixes cache pollution when the time
string contains trailing characters not matched by the format string (e.g. timezone
suffix +08:00). Also add unit test to verify the fix.
@Takuka0311
Copy link
Copy Markdown
Collaborator

Takuka0311 commented May 6, 2026

百炼自动化审查:建议保持开启。

本 PR 修复了 ProcessorParseTimestampNative 中时间字符串二级缓存键计算的缺陷,改用 strptime 实际匹配结束位置计算缓存长度以避免尾部未匹配字符导致的缓存污染,并补充了单元测试。因贡献者尚未签署 CLA 且等待维护者审查与 CI 验证,建议保持开启。.

最佳落地路径:

保持开启。等待贡献者完成 CLA 签署,维护者审查代码变更(重点验证 cacheLen 指针差值计算在各类边界条件下的安全性)及 CI 全量验证通过后合并至 main。.

已核对内容:

百炼审查备注:模型 qwen3.6-max-preview;对照提交 8b91144f8a81

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.

3 participants