Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net
Exact source revision recorded 27 Oct 2026 22:45:55 UTC. It does not establish the source's current position. Latest evidence.
cve-program · CVE-2026-78661
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:38:56 UTC
- Source modified
- 27 Oct 2026 21:38:56 UTC
- Observed here
- 27 Oct 2026 22:45:55 UTC
- Source terms
- CVE Program Terms of Use
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: cve-program · CVE Program Terms of Use. Source text is retained; field grouping and change labels are provided by ChangeIntel.