1
0
mirror of https://github.com/golang/go synced 2024-09-25 07:30:13 -06:00

encoding/pem: fix for TestFuzz, PEM type should not contain a colon

Fixes #22238

Change-Id: I8184f789bd4120f3e71c9374c7c2fcbfa95935bf
Reviewed-on: https://go-review.googlesource.com/132635
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ivan Kutuzov 2018-08-31 09:14:04 -06:00 committed by Brad Fitzpatrick
parent 6f9b94ab66
commit 5188c87c95

View File

@ -213,7 +213,9 @@ func TestFuzz(t *testing.T) {
} }
testRoundtrip := func(block Block) bool { testRoundtrip := func(block Block) bool {
if isBad(block.Type) { // Reject bad Type
// Type with colons will proceed as key/val pair and cause an error.
if isBad(block.Type) || strings.Contains(block.Type, ":") {
return true return true
} }
for key, val := range block.Headers { for key, val := range block.Headers {