Skip to content

Commit

Permalink
Merge pull request #45 from reki9185/fix/out-of-bound
Browse files Browse the repository at this point in the history
Fix: out of range error in suci to supi
  • Loading branch information
ianchen0119 authored Jan 22, 2025
2 parents 103a027 + c2de809 commit b795f60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/suci/suci.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func ToSupi(suci string, suciProfiles []SuciProfile) (string, error) {
if err != nil {
return "", fmt.Errorf("Parse HNPublicKeyID error: %+v", err)
}
if keyIndex > len(suciProfiles) {
if keyIndex < 1 || keyIndex > len(suciProfiles) {
return "", fmt.Errorf("keyIndex(%d) out of range(%d)", keyIndex, len(suciProfiles))
}

Expand Down

0 comments on commit b795f60

Please sign in to comment.