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

[tor-commits] [torbrowser/maint-2.4] Bug 8234: Fix MacOS crash.



commit f3938fb83d5995b14637bcd61a35caccf6d6cc52
Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date:   Sat Feb 16 00:40:21 2013 -0800

    Bug 8234: Fix MacOS crash.
    
    The GetFirstPartyURI had a codepath that was missing an addref. Also, we
    should ensure the returned URI is mutable.
    
    Luckily there is a helper that does both these things.
---
 ...d-mozIThirdPartyUtil.getFirstPartyURI-API.patch |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/current-patches/firefox/0019-Add-mozIThirdPartyUtil.getFirstPartyURI-API.patch b/src/current-patches/firefox/0019-Add-mozIThirdPartyUtil.getFirstPartyURI-API.patch
index 41dfc25..80144f3 100644
--- a/src/current-patches/firefox/0019-Add-mozIThirdPartyUtil.getFirstPartyURI-API.patch
+++ b/src/current-patches/firefox/0019-Add-mozIThirdPartyUtil.getFirstPartyURI-API.patch
@@ -1,17 +1,17 @@
-From ba78747eade72d0c4aeac7c6c6d5a93417112948 Mon Sep 17 00:00:00 2001
-From: Kathleen Brade <brade@xxxxxxxxxxxxxxxxx>
+From eb5083671adc896d465caa40e188c3e16ddfeb6b Mon Sep 17 00:00:00 2001
+From: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
 Date: Wed, 28 Nov 2012 17:08:29 -0500
 Subject: [PATCH 19/26] Add mozIThirdPartyUtil.getFirstPartyURI API
 
 API allows you to get the url bar URI for a channel or nsIDocument.
 ---
- content/base/src/ThirdPartyUtil.cpp        |   58 ++++++++++++++++++++++++++++
+ content/base/src/ThirdPartyUtil.cpp        |   61 ++++++++++++++++++++++++++++
  content/base/src/ThirdPartyUtil.h          |    2 +
  netwerk/base/public/mozIThirdPartyUtil.idl |   21 ++++++++++
- 3 files changed, 81 insertions(+), 0 deletions(-)
+ 3 files changed, 84 insertions(+), 0 deletions(-)
 
 diff --git a/content/base/src/ThirdPartyUtil.cpp b/content/base/src/ThirdPartyUtil.cpp
-index 97a000e..ae4fa70 100644
+index 97a000e..61e9eae 100644
 --- a/content/base/src/ThirdPartyUtil.cpp
 +++ b/content/base/src/ThirdPartyUtil.cpp
 @@ -7,6 +7,9 @@
@@ -32,7 +32,7 @@ index 97a000e..ae4fa70 100644
    return rv;
  }
  
-@@ -282,3 +286,57 @@ ThirdPartyUtil::GetBaseDomain(nsIURI* aHostURI,
+@@ -282,3 +286,60 @@ ThirdPartyUtil::GetBaseDomain(nsIURI* aHostURI,
  
    return NS_OK;
  }
@@ -62,13 +62,16 @@ index 97a000e..ae4fa70 100644
 +  if (NS_FAILED(rv) && aDoc) {
 +    nsCOMPtr<nsIDOMWindow> top;
 +    nsCOMPtr<nsIDOMDocument> topDDoc;
++    nsIURI *docURI = nullptr;
 +
 +    if (aDoc->GetWindow()) {
 +      aDoc->GetWindow()->GetTop(getter_AddRefs(top));
 +      top->GetDocument(getter_AddRefs(topDDoc));
 +
 +      nsCOMPtr<nsIDocument> topDoc(do_QueryInterface(topDDoc));
-+      *aOutput = topDoc->GetOriginalURI();
++      docURI = topDoc->GetOriginalURI();
++      // Give us a mutable URI and also addref
++      rv = NS_EnsureSafeToReturn(docURI, aOutput);
 +    } else {
 +      // XXX: Chrome callers (such as NoScript) can end up here
 +      // through getImageData/canvas usage with no document state



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