]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.24] encoding/pem: properly calculate end indexes
authorRoland Shoemaker <roland@golang.org>
Thu, 23 Oct 2025 15:16:39 +0000 (08:16 -0700)
committerMichael Knyszek <mknyszek@google.com>
Wed, 29 Oct 2025 16:22:33 +0000 (09:22 -0700)
commit562709bcf5b8f480d722d2f369d7757cb135e9ab
tree7d6d1b45a1c7eb05113293196465afef4042f7b2
parentbbf8f423abc9f92f4c1c5d98281ed0b21107b00d
[release-branch.go1.24] encoding/pem: properly calculate end indexes

When a block is missing the END line trailer, calculate the indexes of
the end and end trailer _before_ continuing the loop, making the
reslicing at the start of the loop work as expected.

Fixes #76028

Change-Id: If45c8cb473315623618f02cc7609f517a72d232d
Reviewed-on: https://go-review.googlesource.com/c/go/+/714200
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit 839da71f8907ac4434299db4353db31835c916df)
Reviewed-on: https://go-review.googlesource.com/c/go/+/714680
Reviewed-by: David Chase <drchase@google.com>
src/encoding/pem/pem.go
src/encoding/pem/pem_test.go