Advertisement
gsvelto

Untitled

Apr 7th, 2021
854
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.59 KB | None | 0 0
  1. # HG changeset patch
  2. # User Gabriele Svelto <gsvelto@mozilla.com>
  3. # Date 1615296141 -3600
  4. #      Tue Mar 09 14:22:21 2021 +0100
  5. # Node ID ffdd8f4ebf2f5a35216a4432b36aed5efee51fe8
  6. # Parent  52587fdeade51491c288fca5a43543a439d4a9c4
  7. __fastfail() about:crashparent
  8.  
  9. diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp
  10. --- a/docshell/base/nsAboutRedirector.cpp
  11. +++ b/docshell/base/nsAboutRedirector.cpp
  12. @@ -7,16 +7,17 @@
  13.  #include "nsAboutRedirector.h"
  14.  #include "nsNetUtil.h"
  15.  #include "nsAboutProtocolUtils.h"
  16.  #include "nsBaseChannel.h"
  17.  #include "mozilla/ArrayUtils.h"
  18.  #include "nsIProtocolHandler.h"
  19.  #include "nsXULAppAPI.h"
  20.  #include "mozilla/Preferences.h"
  21. +#include "intrin.h"
  22.  
  23.  #define ABOUT_CONFIG_ENABLED_PREF "general.aboutConfig.enable"
  24.  
  25.  NS_IMPL_ISUPPORTS(nsAboutRedirector, nsIAboutModule)
  26.  
  27.  struct RedirEntry {
  28.    const char* id;
  29.    const char* url;
  30. @@ -28,16 +29,17 @@ class CrashChannel final : public nsBase
  31.    explicit CrashChannel(nsIURI* aURI) { SetURI(aURI); }
  32.  
  33.    nsresult OpenContentStream(bool async, nsIInputStream** stream,
  34.                               nsIChannel** channel) override {
  35.      nsAutoCString spec;
  36.      mURI->GetSpec(spec);
  37.  
  38.      if (spec.EqualsASCII("about:crashparent") && XRE_IsParentProcess()) {
  39. +      __fastfail(FAST_FAIL_INCORRECT_STACK);
  40.        MOZ_CRASH("Crash via about:crashparent");
  41.      }
  42.  
  43.      if (spec.EqualsASCII("about:crashcontent") && XRE_IsContentProcess()) {
  44.        MOZ_CRASH("Crash via about:crashcontent");
  45.      }
  46.  
  47.      NS_WARNING("Unhandled about:crash* URI or wrong process");
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement