Skip to content

Convert string to int64 with ParseInt to prevent overflow on 32-bit systems#21

Open
Pippadi wants to merge 4 commits intoNetflix:masterfrom
Pippadi:master
Open

Convert string to int64 with ParseInt to prevent overflow on 32-bit systems#21
Pippadi wants to merge 4 commits intoNetflix:masterfrom
Pippadi:master

Conversation

@Pippadi
Copy link
Copy Markdown

@Pippadi Pippadi commented May 3, 2022

strconv.Atoi returns an int, which isn't guaranteed to be 64-bit on all platforms. To prevent ints from overflowing on 32-bit platforms when setting int64 fields, strconv.ParseInt is used instead.

@hinshun
Copy link
Copy Markdown
Contributor

hinshun commented May 3, 2022

Thanks @Pippadi, can we add a test of some sort?

@Pippadi
Copy link
Copy Markdown
Author

Pippadi commented May 4, 2022

Just added to TestUnmarshal. Passes with GOARCH=386 go test.
Is this what you were looking for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants