Skip to content

Fix crash in parse_date_id triggered by certain ID field patterns#1588

Merged
ma8ma merged 1 commit intomasterfrom
fix-1587-parse-date-id-crash
May 2, 2026
Merged

Fix crash in parse_date_id triggered by certain ID field patterns#1588
ma8ma merged 1 commit intomasterfrom
fix-1587-parse-date-id-crash

Conversation

@ma8ma
Copy link
Copy Markdown
Collaborator

@ma8ma ma8ma commented May 2, 2026

日付・ID解析処理で特定の入力によりクラッシュする問題を修正します

ID判定で文字列のインデックスアクセスを行っていたため、
特定の形式の入力において std::string_view の範囲外アクセスが発生し、
アサーション失敗により異常終了する場合がありました。

ID判定を std::string_view::compare() を用いた安全な比較に変更し、
範囲外アクセスを防止します。

この問題は @mtasaka さんにより報告および修正案が提示されました。
ご協力ありがとうございます。


Fix a crash caused by out-of-bounds access in ID parsing.

The previous implementation accessed string_view by index when
checking for "ID". Under certain input patterns, this could lead
to an out-of-bounds access and trigger a std::string_view assertion
failure.

Replace the check with std::string_view::compare() to ensure safe
substring comparison.

Reported and patch suggested by @mtasaka.

修正にあたり不具合報告をしていただきありがとうございました。
Ref: #1587
Ref: https://mao.5ch.io/test/read.cgi/linux/1764825297/495-513n

日付・ID解析処理で特定の入力によりクラッシュする問題を修正します

ID判定で文字列のインデックスアクセスを行っていたため、
特定の形式の入力において `std::string_view` の範囲外アクセスが発生し、
アサーション失敗により異常終了する場合がありました。

ID判定を `std::string_view::compare()` を用いた安全な比較に変更し、
範囲外アクセスを防止します。

この問題は @mtasaka さんにより報告および修正案が提示されました。
ご協力ありがとうございます。

---

Fix a crash caused by out-of-bounds access in ID parsing.

The previous implementation accessed `string_view` by index when
checking for "ID". Under certain input patterns, this could lead
to an out-of-bounds access and trigger a `std::string_view` assertion
failure.

Replace the check with `std::string_view::compare()` to ensure safe
substring comparison.

Reported and patch suggested by @mtasaka.

修正にあたり不具合報告をしていただきありがとうございました。
Ref: #1587
Ref: https://mao.5ch.io/test/read.cgi/linux/1764825297/495-513n

Co-authored-by: Mamoru TASAKA <mtasaka@fedoraproject.org>
@ma8ma ma8ma added the bug バグの追跡 label May 2, 2026
@ma8ma ma8ma linked an issue May 2, 2026 that may be closed by this pull request
@ma8ma ma8ma merged commit fedd47e into master May 2, 2026
38 of 40 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in State of JDim-v0.16.0+ May 2, 2026
@ma8ma ma8ma deleted the fix-1587-parse-date-id-crash branch May 2, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug バグの追跡

Projects

Development

Successfully merging this pull request may close these issues.

linux/1764825297/495の件

1 participant