Use RawToken() instead of Token() for finding nextEnd.

This should improve stability as RawToken() does not
verify that start and end elements match.
This commit is contained in:
Martin Dosch 2024-03-10 11:30:39 +01:00
parent ea4874e8c9
commit 9c5e758356

View File

@ -1461,7 +1461,7 @@ func nextStart(p *xml.Decoder) (xml.StartElement, error) {
func nextEnd(p *xml.Decoder) (xml.EndElement, error) {
p.Strict = false
for {
t, err := p.Token()
t, err := p.RawToken()
if err != nil || t == nil {
return xml.EndElement{}, err
}