]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.25] 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:37 +0000 (09:22 -0700)
commit83885f3c22242f3e4499bb5b12892bc7ba11a74b
treed1a16d093dbc3d90933e9baa4f81558e2ea06be7
parent5ba37a3677d322c442ab77f94d4f92f1acc67dba
[release-branch.go1.25] 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 #76029

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/+/714661
Reviewed-by: David Chase <drchase@google.com>
src/encoding/pem/pem.go
src/encoding/pem/pem_test.go