]> Cypherpunks repositories - gostls13.git/commit
encoding/xml: embedded reference to substruct causes XML marshaller to panic on encoding
authorhopehook <hopehook.com@gmail.com>
Sun, 13 Feb 2022 14:03:56 +0000 (22:03 +0800)
committerIan Lance Taylor <iant@golang.org>
Sun, 20 Feb 2022 20:58:11 +0000 (20:58 +0000)
commit851ecea4cc99ab276109493477b2c7e30c253ea8
tree873519c639328443fd5e8671cb853dc10c49463f
parent0261fa616a16dc37b862691f79c7b4d301dfbe4a
encoding/xml: embedded reference to substruct causes XML marshaller to panic on encoding

When encoding a xml attribute is zero value (IsValid == false), we need
a `continue` to jump over the attribute. If not, followed marshalAttr
function will panic.

Fixes: #50164
Change-Id: I42e064558e7becfbf47728b14cbf5c7afa1e8798
Reviewed-on: https://go-review.googlesource.com/c/go/+/385514
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Trust: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/encoding/xml/marshal.go
src/encoding/xml/marshal_test.go