]> Cypherpunks.ru repositories - gostls13.git/commit
encoding/xml: reduce depth limit on wasm
authorRuss Cox <rsc@golang.org>
Mon, 31 Oct 2022 19:42:13 +0000 (15:42 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 31 Oct 2022 20:35:56 +0000 (20:35 +0000)
commit6695cebeec02c62bd440eec8e982028225984dfb
tree4c32a6dc31ae21f4e3786e6cc3f6c97d5db08cf4
parent4b993bffb83394105d13b426dae12afe0ab05804
encoding/xml: reduce depth limit on wasm

Wasm can't handle the recusion for XML nested to depth 10,000.
Cut it off at 5,000 instead. This fixes TestCVE202228131 on trybots
in certain conditions.

Also disable TestCVE202230633 to fix 'go test -v encoding/xml' on gomotes.

Also rename errExeceededMaxUnmarshalDepth [misspelled and unwieldy]
to errUnmarshalDepth.

For #56498.

Change-Id: I7cc337ccfee251bfd9771497be0e5272737114f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/446639
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/encoding/xml/read.go
src/encoding/xml/read_test.go