From f981a1aa9054d0832fcc8120147f44d10e035019 Mon Sep 17 00:00:00 2001 From: Georg Koppen Date: Fri, 4 Aug 2017 05:55:49 +0000 Subject: [PATCH] Bug 21830: Copying large text from web console leaks to /tmp Patch written by Neill Miller --- widget/nsTransferable.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/widget/nsTransferable.cpp b/widget/nsTransferable.cpp index 4db142c5a370b..947b7b530df7a 100644 --- a/widget/nsTransferable.cpp +++ b/widget/nsTransferable.cpp @@ -36,6 +36,7 @@ Notes to self: #include "nsILoadContext.h" #include "nsXULAppAPI.h" #include "mozilla/UniquePtr.h" +#include "mozilla/Preferences.h" using namespace mozilla; @@ -198,6 +199,11 @@ 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 = + mozilla::Preferences::GetBool("browser.privatebrowsing.autostart"); } #ifdef DEBUG mInitialized = true; -- GitLab