Skip to content

Commit

Permalink
Merge branch 'omp-jb50110-geolocation' into 'master'
Browse files Browse the repository at this point in the history
[sailfishos][gecko] Skip invalid WatchId in geolocation.clearWatch(). Contributes to JB#50110

See merge request mer-core/gecko-dev!120
  • Loading branch information
rainemak committed Sep 15, 2020
2 parents dd752b0 + 4e60c3a commit 227503f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions rpm/0029-Skip-invalid-WatchId-in-geolocation.clearWatch.patch
@@ -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

1 change: 1 addition & 0 deletions rpm/xulrunner-qt5.spec
Expand Up @@ -72,6 +72,7 @@ Patch25: 0025-Prioritize-GMP-plugins-over-all-others-and-support-d.patch
Patch26: 0026-Delete-startupCache-if-it-s-stale.patch
Patch27: 0027-Remove-android-define-from-logging.patch
Patch28: 0028-Fix-build-of-nsPrintSettingsQt-and-nsDeviceContextSp.patch
Patch29: 0029-Skip-invalid-WatchId-in-geolocation.clearWatch.patch

BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Network)
Expand Down

0 comments on commit 227503f

Please sign in to comment.