You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Jens-G (via GitHub)" <gi...@apache.org> on 2026/05/24 16:45:59 UTC
[PR] THRIFT-6027: Fix UB/assertion in t_markdown_generator::str_to_id [thrift]
Jens-G opened a new pull request, #3523:
URL: https://github.com/apache/thrift/pull/3523
## Summary
- `str_to_id` used `chr<=s.end()` as loop condition, causing the body to execute when `chr==end()`. Dereferencing the end iterator is undefined behaviour and triggers a hard assertion in debug builds (`_GLIBCXX_DEBUG`).
- Removes the dead `*chr == 0` check — a C-string-style null-terminator guard that can never be true for a `std::string` iterator.
- Rewrites the loop as a range-for to eliminate both issues.
- Adds `--gen markdown` to the `check-local` target in `test/Makefile.am`, matching the existing `--gen html` smoke test.
## Test plan
- [x] Debug build (`CMAKE_BUILD_TYPE=Debug`) no longer aborts with STL assertion on `--gen markdown`
- [x] `--gen markdown test/ThriftTest.thrift` produces valid output
- [x] `make check` (autotools) now covers `--gen markdown` via the updated `check-local` target
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] THRIFT-6027: Fix UB/assertion in t_markdown_generator::str_to_id [thrift]
Posted by "Jens-G (via GitHub)" <gi...@apache.org>.
Jens-G merged PR #3523:
URL: https://github.com/apache/thrift/pull/3523
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org