Repository navigation
Conversation
PGZXB
requested review from
a team,
Noah-Kennedy,
jasnell and
orium
as code owners
September 25, 2026 08:25
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.
Fixes #336.
lol_html_attributes_iterator_getreturned astd::slice::Iterborrowed from the element's attributeVec.lol_html_element_set_attribute(andlol_html_element_remove_attribute) grow or rebuild thatVec, so the next call tolol_html_attributes_iterator_nextwalked a stale slice cursor into a buffer that had already been freed, even though the iterator is documented to stay valid for the whole handler.The iterator now carries the element pointer and a cursor and
_nextre-reads the element's attributes on each call, so mutating the element between calls no longer invalidates the iteration:Verified with the reproducer from the issue (
<div a="1" b="2" c="3">, advance once, mutate, advance again), built against the C API with AddressSanitizer. Before the change it reportsERROR: AddressSanitizer: heap-use-after-freeon the secondnext; after the change it runs cleanly and prints the next attribute.cargo fmt --checkandcargo clippy --manifest-path=c-api/Cargo.tomlare clean.