Skip to content

Commit

Permalink
fix: out of range error in suci to supi
Browse files Browse the repository at this point in the history
  • Loading branch information
reki9185 committed Jan 21, 2025
1 parent 4985943 commit 36ed20e
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 36ed20e

Please sign in to comment.