Frank-Rainer Grahl 3 months ago
parent
commit
74285db655

+ 33 - 0
mozilla-release/patches/1440397-60a1.patch

@@ -0,0 +1,33 @@
+# HG changeset patch
+# User Christian Holler <choller@mozilla.com>
+# Date 1520013660 -3600
+# Node ID f820b72a3f80d911a6c1882dda982a9f6b4269df
+# Parent  0cf68337438c40dfb45019148759e7230a353a4c
+Bug 1440397 - Handle unexpected principal tag gracefully in FUZZING. r=baku
+
+diff --git a/caps/nsJSPrincipals.cpp b/caps/nsJSPrincipals.cpp
+--- a/caps/nsJSPrincipals.cpp
++++ b/caps/nsJSPrincipals.cpp
+@@ -218,17 +218,21 @@ ReadPrincipalInfo(JSStructuredCloneReade
+         if (!ReadPrincipalInfo(aReader, attrs, spec, originNoSuffix)) {
+             return false;
+         }
+ 
+         MOZ_DIAGNOSTIC_ASSERT(!originNoSuffix.IsEmpty());
+ 
+         aInfo = ContentPrincipalInfo(attrs, originNoSuffix, spec);
+     } else {
++#ifdef FUZZING
++        return false;
++#else
+         MOZ_CRASH("unexpected principal structured clone tag");
++#endif
+     }
+ 
+     return true;
+ }
+ 
+ /* static */ bool
+ nsJSPrincipals::ReadKnownPrincipalType(JSContext* aCx,
+                                        JSStructuredCloneReader* aReader,
+

+ 34 - 0
mozilla-release/patches/1442716-60a1.patch

@@ -0,0 +1,34 @@
+# HG changeset patch
+# User Christian Holler <choller@mozilla.com>
+# Date 1520016529 -3600
+# Node ID 23b9459e1db5a9a2096b37ae706b3a023b435505
+# Parent  b8f0901cc921872fe903a90a1fcab96b3aca2c24
+Bug 1442716 - [caps] Handle empty origin gracefully in FUZZING. r=baku
+
+diff --git a/caps/nsJSPrincipals.cpp b/caps/nsJSPrincipals.cpp
+--- a/caps/nsJSPrincipals.cpp
++++ b/caps/nsJSPrincipals.cpp
+@@ -214,16 +214,22 @@ ReadPrincipalInfo(JSStructuredCloneReade
+     } else if (aTag == SCTAG_DOM_CONTENT_PRINCIPAL) {
+         OriginAttributes attrs;
+         nsAutoCString spec;
+         nsAutoCString originNoSuffix;
+         if (!ReadPrincipalInfo(aReader, attrs, spec, originNoSuffix)) {
+             return false;
+         }
+ 
++#ifdef FUZZING
++        if (originNoSuffix.IsEmpty()) {
++          return false;
++        }
++#endif
++
+         MOZ_DIAGNOSTIC_ASSERT(!originNoSuffix.IsEmpty());
+ 
+         aInfo = ContentPrincipalInfo(attrs, originNoSuffix, spec);
+     } else {
+ #ifdef FUZZING
+         return false;
+ #else
+         MOZ_CRASH("unexpected principal structured clone tag");
+

+ 102 - 0
mozilla-release/patches/1443236-60a1.patch

@@ -0,0 +1,102 @@
+# HG changeset patch
+# User Nathan Froyd <froydnj@mozilla.com>
+# Date 1520276810 18000
+# Node ID 33b5b920262cca3e0a14159e39e64292e43eeb09
+# Parent  8ca561da570e085b63189861cd124eef4275c9e1
+Bug 1443236 - remove static init and shutdown nsRegion routines; r=kats
+
+These routines are no-ops; let's get rid of them.
+
+diff --git a/gfx/src/nsRegion.h b/gfx/src/nsRegion.h
+--- a/gfx/src/nsRegion.h
++++ b/gfx/src/nsRegion.h
+@@ -88,25 +88,16 @@ public:
+ 
+   void Swap(nsRegion* aOther)
+   {
+     pixman_region32_t tmp = mImpl;
+     mImpl = aOther->mImpl;
+     aOther->mImpl = tmp;
+   }
+ 
+-  static
+-  nsresult InitStatic()
+-  {
+-    return NS_OK;
+-  }
+-
+-  static
+-  void ShutdownStatic() {}
+-
+   void AndWith(const nsRegion& aOther)
+   {
+     And(*this, aOther);
+   }
+   void AndWith(const nsRect& aOther)
+   {
+     And(*this, aOther);
+   }
+diff --git a/ipc/ipdl/test/cxx/IPDLUnitTestProcessChild.cpp b/ipc/ipdl/test/cxx/IPDLUnitTestProcessChild.cpp
+--- a/ipc/ipdl/test/cxx/IPDLUnitTestProcessChild.cpp
++++ b/ipc/ipdl/test/cxx/IPDLUnitTestProcessChild.cpp
+@@ -17,16 +17,13 @@ namespace _ipdltest {
+ 
+ bool
+ IPDLUnitTestProcessChild::Init(int aArgc, char* aArgv[])
+ {
+     IPDLUnitTestChildInit(IOThreadChild::channel(),
+                           ParentPid(),
+                           IOThreadChild::message_loop());
+ 
+-    if (NS_FAILED(nsRegion::InitStatic()))
+-      return false;
+-
+     return true;
+ }
+ 
+ } // namespace _ipdltest
+ } // namespace mozilla
+diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp
+--- a/layout/build/nsLayoutStatics.cpp
++++ b/layout/build/nsLayoutStatics.cpp
+@@ -155,21 +155,16 @@ nsLayoutStatics::Initialize()
+   nsColorNames::AddRefTable();
+   nsGkAtoms::AddRefAtoms();
+   nsHTMLTags::RegisterAtoms();
+   nsRDFAtoms::RegisterAtoms();
+ 
+   NS_SealStaticAtomTable();
+ 
+   StartupJSEnvironment();
+-  rv = nsRegion::InitStatic();
+-  if (NS_FAILED(rv)) {
+-    NS_ERROR("Could not initialize nsRegion");
+-    return rv;
+-  }
+ 
+   nsGlobalWindow::Init();
+   Navigator::Init();
+   nsXBLService::Init();
+ 
+   rv = nsContentUtils::Init();
+   if (NS_FAILED(rv)) {
+     NS_ERROR("Could not initialize nsContentUtils");
+@@ -413,18 +408,16 @@ nsLayoutStatics::Shutdown()
+   TouchManager::ReleaseStatics();
+ 
+   nsTreeSanitizer::ReleaseStatics();
+ 
+   nsHtml5Module::ReleaseStatics();
+ 
+   mozilla::dom::FallbackEncoding::Shutdown();
+ 
+-  nsRegion::ShutdownStatic();
+-
+   mozilla::EventDispatcher::Shutdown();
+ 
+   HTMLInputElement::DestroyUploadLastDir();
+ 
+   nsLayoutUtils::Shutdown();
+   mozilla::SharedFontList::Shutdown();
+ 
+   nsHyphenationManager::Shutdown();

+ 3 - 0
mozilla-release/patches/series

@@ -7184,3 +7184,6 @@ TOP-NOBUG-fixups-25320.patch
 1680802-3-86a1.patch
 1692254-87a1.patch
 1692280-87a1.patch
+1440397-60a1.patch
+1442716-60a1.patch
+1443236-60a1.patch