Repository navigation
Fix panic on definition-list offsets inside a combining character - #1143
Merged
notriddle merged 1 commit intoSep 10, 2026
Merged
Conversation
A TAB-indented second definition computed its start as container_start - outer_indent. outer_indent is columns, so that subtraction could land inside a preceding multibyte character (U+0301 in issue 1142) and into_offset_iter ranges were not valid &str slices.
Collaborator
|
Thanks, but please put the test in |
Contributor
Author
|
specs only compare HTML output, and this input renders the same with and without the fix, so a case there passes either way. The panic is in |
Collaborator
|
Good point, thanks. |
notriddle
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
into_offset_iterpanicked on this definition list, found by a fuzzer:The second definition's start was
container_start - outer_indent.outer_indentis columns, not bytes, so with a leftover tab width the start landed inside U+0301 (bytes 3..5) at index 4.Use
start_ix + save.bytes_scanned()for that start instead, same as the indent that was actually consumed.issue_1142_deflist_offset_is_char_boundaryslices every offset range of that input.cargo test -p pulldown-cmark1248 tests + 6 doctests passed.Closes #1142.