From c910cfc1ba335a9292ec39bd2cd22ab74717ab09 Mon Sep 17 00:00:00 2001 From: lestrrat <49281+lestrrat@users.noreply.github.com> Date: Tue, 14 May 2024 08:33:25 +0900 Subject: [PATCH] See if this silences CodeQL (#1129) * 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> --- jwt/openid/birthdate.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/jwt/openid/birthdate.go b/jwt/openid/birthdate.go index a193b4034..929f925c6 100644 --- a/jwt/openid/birthdate.go +++ b/jwt/openid/birthdate.go @@ -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) }