admin: Fix race in revokeSerials (#8107)

Redeclare `err` rather than assigning to the parent function's `err`, as
there are multiple goroutines running. Thanks to @jsha for the
diagnosis.
This commit is contained in:
James Renken 2025-04-08 13:15:25 -04:00 committed by GitHub
parent 38a7197909
commit b9f93b386f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -323,7 +323,7 @@ func (a *admin) revokeSerials(ctx context.Context, serials []string, reason revo
go func() {
defer wg.Done()
for serial := range work {
_, err = a.rac.AdministrativelyRevokeCertificate(
_, err := a.rac.AdministrativelyRevokeCertificate(
ctx,
&rapb.AdministrativelyRevokeCertificateRequest{
Serial: serial,