chore: return safe copy of string slice in 'ParseStringSliceClaim' (#17439)

Claims parsed should be safe to mutate and filter. This was likely not
causing any bugs or issues, and just doing this out of precaution
This commit is contained in:
Steven Masley
2025-04-28 12:18:02 -05:00
committed by GitHub
parent 9167cbfe4c
commit 37c5e7c440
2 changed files with 14 additions and 1 deletions

View File

@ -186,7 +186,9 @@ func ParseStringSliceClaim(claim interface{}) ([]string, error) {
// The simple case is the type is exactly what we expected
asStringArray, ok := claim.([]string)
if ok {
return asStringArray, nil
cpy := make([]string, len(asStringArray))
copy(cpy, asStringArray)
return cpy, nil
}
asArray, ok := claim.([]interface{})