[tor-commits] [tor-browser/tor-browser-31.4.0esr-4.5-1] Bug 12430: Disable external jar: via preference

mikeperry at torproject.org mikeperry at torproject.org
Wed Feb 11 22:54:00 UTC 2015


commit a4a1c52ccc7f8e5f60c2d0e35d40b3b5f5ddd71f
Author: Georg Koppen <gk at torproject.org>
Date:   Fri Jan 30 16:05:21 2015 +0000

    Bug 12430: Disable external jar: via preference
    
    This is a patch written by Jeff Gibat (iSECPartners) to disable the
    jar: protocol handler via a preference. The preference is bound to the
    security slider settings (#9387).
---
 modules/libjar/nsJARChannel.cpp |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp
index d190973..f958554 100644
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -898,6 +898,12 @@ nsJARChannel::OnDownloadComplete(nsIDownloader *downloader,
         mContentDisposition = NS_GetContentDispositionFromHeader(mContentDispositionHeader, this);
     }
 
+    // here we check preferences to see if all remote jar support should be disabled
+    if (Preferences::GetBool("network.jar.block-remote-files", true)) {
+        mIsUnsafe = true;
+        status = NS_ERROR_UNSAFE_CONTENT_TYPE;
+    }
+
     if (NS_SUCCEEDED(status) && mIsUnsafe &&
         !Preferences::GetBool("network.jar.open-unsafe-types", false)) {
         status = NS_ERROR_UNSAFE_CONTENT_TYPE;





More information about the tor-commits mailing list