Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'omp-jb50110-geolocation' into 'master'
[sailfishos][gecko] Skip invalid WatchId in geolocation.clearWatch(). Contributes to JB#50110 See merge request mer-core/gecko-dev!120
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
rpm/0029-Skip-invalid-WatchId-in-geolocation.clearWatch.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From 790f73acb37aff29a4791d660fb898433f5c2f49 Mon Sep 17 00:00:00 2001 | ||
From: "p.tumakaev" <p.tumakaev@omprussia.ru> | ||
Date: Mon, 29 Jun 2020 14:29:52 +0300 | ||
Subject: [PATCH] Skip invalid WatchId in geolocation.clearWatch() | ||
|
||
ClearWatch() stores passed WatchId in mClearedWatchIDs without checking | ||
if it was previously generated by WatchPosition(). As a result, all | ||
subsequent WatchPosition() with such invalid identifiers are automatically | ||
canceled at the "Allow" stage. | ||
--- | ||
dom/geolocation/nsGeolocation.cpp | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/dom/geolocation/nsGeolocation.cpp b/dom/geolocation/nsGeolocation.cpp | ||
index 0969cd771dc5..a25172db45db 100644 | ||
--- a/dom/geolocation/nsGeolocation.cpp | ||
+++ b/dom/geolocation/nsGeolocation.cpp | ||
@@ -1354,7 +1354,7 @@ Geolocation::WatchPosition(GeoPositionCallback aCallback, | ||
NS_IMETHODIMP | ||
Geolocation::ClearWatch(int32_t aWatchId) | ||
{ | ||
- if (aWatchId < 0) { | ||
+ if (aWatchId < 0 || aWatchId >= mLastWatchId) { | ||
return NS_OK; | ||
} | ||
|
||
-- | ||
2.17.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters