Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force a new allocation for sans in NamesFromCSR (#6759)
In `csr.NamesFromCSR`, there's a subtle trap when appending to a slice. We set `sans := csr.DNSNames` and then depending on the existence of a CommonName, we append to sans which could mutate the backing array in `csr.DNSNames`. Instead, we will force a new allocation meaning that `sans` has its own pointer to a distinct memory unrelated to the pointer of `csr.DNSNames`. See this blog post too: https://build-your-own.org/blog/20230316_go_full_slice/
- Loading branch information