]> Cypherpunks repositories - gostls13.git/commit
encoding/json: validate strings when decoding into Number
authorLucas Bremgartner <lucas@bremis.ch>
Mon, 16 Sep 2019 19:46:12 +0000 (19:46 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Mon, 16 Sep 2019 21:56:53 +0000 (21:56 +0000)
commitc1000c500cb4cec2991f8c1924cd5fff05279658
tree437a1dba9133567ff611ffad29f926971f88e2d7
parent0e0bff840e3cd041aa9d103c6135862faae9c03f
encoding/json: validate strings when decoding into Number

Unmarshaling a string into a json.Number should first check that the string is a valid Number.
If not, we should fail without decoding it.

Fixes #14702

Change-Id: I286178e93df74ad63c0a852c3f3489577072cf47
GitHub-Last-Rev: fe69bb68eed06d056639f440d2daf4bb7c99013b
GitHub-Pull-Request: golang/go#34272
Reviewed-on: https://go-review.googlesource.com/c/go/+/195045
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/encoding/json/decode.go
src/encoding/json/decode_test.go