]> Cypherpunks repositories - gostls13.git/commit
encoding/pem: properly calculate end indexes
authorRoland Shoemaker <roland@golang.org>
Thu, 23 Oct 2025 15:16:39 +0000 (08:16 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 23 Oct 2025 15:52:44 +0000 (08:52 -0700)
commit839da71f8907ac4434299db4353db31835c916df
tree0e495a6a2d05890044eeeb8799b1a1127a3cee1c
parent39ed968832ad8923a4bd1fb6bc3d9090ddd98401
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.

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>
src/encoding/pem/pem.go
src/encoding/pem/pem_test.go