[tor-commits] [tor-browser] 05/90: Bug 1768907 - Part 2: nsTransferable disk-leaks when private browsing mode is enabled by default. r=handyman

gitolite role git at cupani.torproject.org
Tue Nov 22 09:57:40 UTC 2022


This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-102.5.0esr-12.0-1
in repository tor-browser.

commit 3e2f61607e82b25a6ba2dfaff01e1db2e50eee5d
Author: Neill Miller <neillm at thecodefactory.org>
AuthorDate: Thu Sep 22 00:26:17 2022 +0000

    Bug 1768907 - Part 2: nsTransferable disk-leaks when private browsing mode is enabled by default. r=handyman
    
    nsTransferable was modified to prevent disk leakings when copying data
    in private browsing mode with Bug 1123480.
    However, the context is nullptr when it is initialized, so it still
    leaks if PBM is enabled by default.
    Our solution is to check the browser.privatebrowsing.autostart in this
    condition.
    
    Differential Revision: https://phabricator.services.mozilla.com/D157800
---
 widget/nsTransferable.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/widget/nsTransferable.cpp b/widget/nsTransferable.cpp
index c82549a4d1d1..2f42268ecfd2 100644
--- a/widget/nsTransferable.cpp
+++ b/widget/nsTransferable.cpp
@@ -32,6 +32,7 @@ Notes to self:
 #include "nsNetUtil.h"
 #include "nsILoadContext.h"
 #include "nsXULAppAPI.h"
+#include "mozilla/StaticPrefs_browser.h"
 #include "mozilla/UniquePtr.h"
 
 using namespace mozilla;
@@ -195,6 +196,10 @@ nsTransferable::Init(nsILoadContext* aContext) {
 
   if (aContext) {
     mPrivateData = aContext->UsePrivateBrowsing();
+  } else {
+    // without aContext here to provide PrivateBrowsing information, we defer to
+    // the active configured setting
+    mPrivateData = StaticPrefs::browser_privatebrowsing_autostart();
   }
 #ifdef DEBUG
   mInitialized = true;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list