]> Cypherpunks repositories - gostls13.git/commit
encoding/pem: properly decode strange PEM data
authorRoland Shoemaker <roland@golang.org>
Wed, 15 Oct 2025 17:45:04 +0000 (10:45 -0700)
committerRoland Shoemaker <roland@golang.org>
Fri, 17 Oct 2025 15:44:33 +0000 (08:44 -0700)
commit09830901714d8b3a2cc5fb33e87a81886b21ea24
treef916eecc42b12b9486ec155dfad501424315b848
parent36863d619400910a2728c07615afe91c17415ef4
encoding/pem: properly decode strange PEM data

When the passed byte slice has leading garbage, properly handle ignoring
it and continuing to parse the slice until we find a valid block (or
nothing).

Change-Id: I07e937d9c754fd71b028b99450b48f57b4464457
Reviewed-on: https://go-review.googlesource.com/c/go/+/712140
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/encoding/pem/pem.go
src/encoding/pem/pem_test.go