]> Cypherpunks repositories - gostls13.git/commit
encoding/gob: clean up decoderMap after errBadType
authorHÃ¥vard Haugen <havard.haugen@gmail.com>
Wed, 28 Jan 2015 22:07:05 +0000 (23:07 +0100)
committerRob Pike <r@golang.org>
Wed, 8 Apr 2015 21:28:24 +0000 (21:28 +0000)
commit8e6cf5f70c77daadf1b2c798f227031be156a904
tree91cb9fc08162baccf744ef0581f00884e2aedbab
parentb28802d2f1ba9ef49fc3608d7026a524a98bdddb
encoding/gob: clean up decoderMap after errBadType

When decoding an invalid typeId the associated *decEngine was not
removed from decoderMap. If the decoder was run again on the same input
a nil *decEngine was found in the map and assumed to be initialized,
resulting in a panic.

Fixes #9649

Change-Id: I5bb51808362a21c09228c2705a658f073e5b59b3
Reviewed-on: https://go-review.googlesource.com/3509
Reviewed-by: Rob Pike <r@golang.org>
src/encoding/gob/codec_test.go
src/encoding/gob/decode.go