]> Cypherpunks.ru repositories - gostls13.git/commit
encoding/hex: fix Decode output check regression
authorJoe Tsai <joetsai@digital-static.net>
Mon, 6 Feb 2023 22:48:19 +0000 (14:48 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 7 Feb 2023 15:37:55 +0000 (15:37 +0000)
commitf02cdba16398cee70a69262a55eb357dac6f81df
tree934cb82023f14a50a02977af40da542fc88aec2a
parent02d8ebda8398342516a24a3e8435d527ed156cab
encoding/hex: fix Decode output check regression

CL 461958 fixed a potential panic,
but also introduced an observable regression where
invalid input could be detected before the panic occurs.
Adjust the check to preserve prior behavior,
while also preventing the panic.

Change-Id: I52819f88a6a64883fbc9fd512697c38c29ca0ccd
Reviewed-on: https://go-review.googlesource.com/c/go/+/465855
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/encoding/hex/hex.go
src/encoding/hex/hex_test.go