I already reported the issue in the CL where it was introduced. /cc @stevenh @bradfitz Creating this issue for posterity, so I can reference it in the CL I'm about to send.
TestEnvVars contains this code:
for i, cn := range tc.cns {
if i > len(r.certs) {
t.Errorf("missing cert %v @ %v", cn, i)
} else if r.certs[i].Subject.CommonName != cn {
// ...
}
}
It should have i >= len(r.certs) instead, otherwise r.certs[i] in the else if will panic when i == len(r.certs).
This panic happens when the test fails due to the returned number of certificates (r.certs) being less than expected by test case (tc.cns).
CL upcoming. Edit: Sent CL 46715.
I already reported the issue in the CL where it was introduced. /cc @stevenh @bradfitz Creating this issue for posterity, so I can reference it in the CL I'm about to send.
TestEnvVarscontains this code:It should have
i >= len(r.certs)instead, otherwiser.certs[i]in theelse ifwill panic wheni == len(r.certs).This panic happens when the test fails due to the returned number of certificates (
r.certs) being less than expected by test case (tc.cns).CL upcoming. Edit: Sent CL 46715.