Skip to content

Commit

Permalink
See if this silences CodeQL (#1129)
Browse files Browse the repository at this point in the history
* Fix building on 32-bit systems

* Try this to appease CodeQL

* Trying one more option to see if CodeQL is happy

* Maybe needed this too?

* Simplify

---------

Co-authored-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
  • Loading branch information
lestrrat and ItalyPaleAle authored May 13, 2024
1 parent dfa27f9 commit c910cfc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions jwt/openid/birthdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,17 @@ func (b *BirthdateClaim) UnmarshalJSON(data []byte) error {
var intSize int

func init() {
switch math.MaxInt {
case math.MaxInt16:
intSize = 16
case math.MaxInt32:
intSize = 64
if math.MaxInt == math.MaxInt32 {
intSize = 32
case math.MaxInt64:
intSize = 64
}
}

func parseBirthdayInt(s string) int {
i, _ := strconv.ParseInt(s, 10, intSize)
i, err := strconv.ParseInt(s, 10, intSize)
if err != nil {
return 0
}
return int(i)
}

Expand Down

0 comments on commit c910cfc

Please sign in to comment.