mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1062112: Part 1d: Correctly define 2^32. r=nalexander
This commit is contained in:
parent
c21ba4f0b0
commit
dfbea21c99
@ -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