Closed
Bug 463039
Opened 16 years ago
Closed 16 years ago
validate values that get passed to clearWatch
Categories
(Core :: DOM: Geolocation, defect)
Core
DOM: Geolocation
Tracking
()
RESOLVED
FIXED
mozilla1.9.1
People
(Reporter: dougt, Assigned: dougt)
Details
(Keywords: fixed1.9.1)
Attachments
(2 files)
5.24 KB,
patch
|
jst
:
review+
jst
:
superreview+
beltzner
:
approval1.9.1b2+
|
Details | Diff | Splinter Review |
688 bytes,
patch
|
timeless
:
review+
|
Details | Diff | Splinter Review |
We should ensure that the value passed to clearWatch is something that can be in the array. Test for > 0 and < Max
Assignee | ||
Comment 1•16 years ago
|
||
i am also going to convert our code from using unsigned shorts to longs to make the current specification (which uses signed ints). This may change, but until it does we should do the right thing.
Assignee | ||
Comment 2•16 years ago
|
||
Attachment #346483 -
Flags: superreview?(jst)
Attachment #346483 -
Flags: review?(jst)
Assignee | ||
Updated•16 years ago
|
Flags: blocking1.9.1?
Comment 3•16 years ago
|
||
Comment on attachment 346483 [details] [diff] [review]
patch v.1
nsGeolocation::ClearWatch(PRInt32 aWatchId):
+ PRUint32 count = mWatchingCallbacks.Length();
+
+ if (aWatchId < 0 || count == 0 || aWatchId > count + 1)
+ return NS_ERROR_FAILURE;
That should be aWatchId > count, not count + 1.
r+sr=jst with that.
Attachment #346483 -
Flags: superreview?(jst)
Attachment #346483 -
Flags: superreview+
Attachment #346483 -
Flags: review?(jst)
Attachment #346483 -
Flags: review+
Updated•16 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
Target Milestone: --- → mozilla1.9.1b2
Updated•16 years ago
|
Attachment #346483 -
Flags: approval1.9.1b2+
Comment 4•16 years ago
|
||
Comment on attachment 346483 [details] [diff] [review]
patch v.1
a=beltzner since it comes in a bundle with the blockers
Updated•16 years ago
|
Target Milestone: mozilla1.9.1b2 → mozilla1.9.1
Assignee | ||
Comment 5•16 years ago
|
||
pushed a1364547a182.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Keywords: fixed1.9.1
Comment 6•16 years ago
|
||
This patch added this compile warning:
mozilla/dom/src/geolocation/nsGeolocation.cpp:720: warning: comparison between signed and unsigned integer expressions
The responsible comparison is "aWatchId > count", since aWatchId is signed and count is signed.
We should be fine to avoid this warning by casting aWatchId to unsigned, because if we actually hit this comparison, that implies we've already failed the "if (aWatchId < 0)" comparison, and so aWatchId is non-negative.
Version: unspecified → Trunk
Comment 7•16 years ago
|
||
Attachment #375752 -
Flags: review?(doug.turner)
Comment on attachment 375752 [details] [diff] [review]
followup patch to fix build warning
r=me. i wrote the same patch and was going to file a bug.
Attachment #375752 -
Flags: review?(doug.turner) → review+
You need to log in
before you can comment on or make changes to this bug.
Description
•