[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-60.4.0esr-8.5-1] Bug 1473507 - fix crash in nsILoadInfo::GetOriginAttributes when passing no principal to SavePrivacyAwareURI, r=mccr8



commit 11aef302f781e229446fc73251e42efd70c19b38
Author: Gijs Kruitbosch <gijskruitbosch@xxxxxxxxx>
Date:   Thu Jul 5 23:50:45 2018 +0100

    Bug 1473507 - fix crash in nsILoadInfo::GetOriginAttributes when passing no principal to SavePrivacyAwareURI, r=mccr8
    
    Enforce that callers pass triggering principals through to any persist APIs,
    which all delegate to SaveURIInternal.
    
    Also add the missing principal information to the saveURL call in the page
    info dialog code, which was triggering crashes in this way.
    
    MozReview-Commit-ID: L9pNE7BxGws
    
    --HG--
    extra : rebase_source : 957d765f965aa4f942532c693cae36addd8b781d
---
 browser/base/content/pageinfo/pageInfo.js     | 2 +-
 dom/webbrowserpersist/nsWebBrowserPersist.cpp | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js
index 405b9443342d..30344b989007 100644
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -696,7 +696,7 @@ function saveMedia() {
         titleKey = "SaveAudioTitle";
 
       saveURL(url, null, titleKey, false, false, makeURI(item.baseURI),
-              null, gDocInfo.isContentWindowPrivate);
+              null, gDocInfo.isContentWindowPrivate, gDocInfo.principal);
     }
   } else {
     selectSaveFolder(function(aDirectory) {
diff --git a/dom/webbrowserpersist/nsWebBrowserPersist.cpp b/dom/webbrowserpersist/nsWebBrowserPersist.cpp
index 68cb08eac0c0..97650a4b42a0 100644
--- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp
+++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp
@@ -1341,6 +1341,7 @@ nsresult nsWebBrowserPersist::SaveURIInternal(
 {
     NS_ENSURE_ARG_POINTER(aURI);
     NS_ENSURE_ARG_POINTER(aFile);
+    NS_ENSURE_ARG_POINTER(aTriggeringPrincipal);
 
     nsresult rv = NS_OK;
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits