-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
limits/imap.go: Prevent integer overflow on 32 bit platforms #383
Conversation
Is there any reason we can't just use MaxInt32 for limits on all systems, like my original changes did?
|
The maximum range of values we can represent with The maximum range of values we can represent with The current setup works, since While your original change compiles, it has some problems:
|
So you're okay with 32 bit platforms having half the max range as long as 64 bit ones don't also?
|
Yes, 64bit should have full range. I see this as compromise for now. There is much more work required to ensure that one can represent the max range of uint32 correctly across the entire code base in 32bit mode. But at least it would not block people from building under 32bits. |
Looks good now. Could you amend the commit to |
44d2925
to
b0c449f
Compare
I don't know if you were notified, but I did it three days ago. |
Fixes #382
Since the (signed) int type is used, MaxUInt32 is too big for use on 32 bit platforms. Changing to MaxInt32 solves this problem.