Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net
Exact source revision recorded 27 Oct 2026 21:48:52 UTC. It does not establish the source's current position. Latest evidence.
osv · GO-2026-6860
PublishedWhen coalescing adjacent text nodes in addText and fosterParent, appending to an existing TextNode's Data via string concatenation (n.Data += text) reallocated and copied the accumulated string on every token. Inputs containing many short text runs separated by ignored end tags (such as "a</x>") caused O(n^2) allocations and byte copies. Accumulate coalesced text in per-node byte slices during parsing and materialize Data strings once at the end of parse.
- Source published
- 27 Oct 2026 21:16:18 UTC
- Source modified
- 27 Oct 2026 21:30:04 UTC
- Observed here
- 27 Oct 2026 21:48:52 UTC
- Source terms
- OSV · upstream source license applies
Original source record · Cite this exact observation · Complete original publisher JSON
This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: osv · OSV · upstream source license applies. Source text is retained; field grouping and change labels are provided by ChangeIntel.