mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1062112: Part 1d: Correctly define 2^32. r=nalexander
This commit is contained in:
parent
ccdd65da4e
commit
c6e4623844
@ -350,6 +350,9 @@ public class GeckoSmsManager
|
||||
// Used to generate monotonically increasing GUIDs.
|
||||
private static final AtomicInteger pendingIntentGuid = new AtomicInteger(Integer.MIN_VALUE);
|
||||
|
||||
// The maximum value of a 32 bit signed integer. Used to enforce a limit on ids.
|
||||
private static final long UNSIGNED_INTEGER_MAX_VALUE = Integer.MAX_VALUE * 2L + 1L;
|
||||
|
||||
public GeckoSmsManager() {
|
||||
SmsIOThread.getInstance().start();
|
||||
}
|
||||
@ -590,7 +593,7 @@ public class GeckoSmsManager
|
||||
|
||||
// The DOM API takes a 32bits unsigned int for the id. It's unlikely that
|
||||
// we happen to need more than that but it doesn't cost to check.
|
||||
if (id > Integer.MAX_VALUE) {
|
||||
if (id > UNSIGNED_INTEGER_MAX_VALUE) {
|
||||
throw new IdTooHighException();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user