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

[tor-commits] [tor-browser/tor-browser-45.4.0esr-6.5-1] Bug 20304: SOCKS socket does not support spaces and other special characters



commit 48a73d262e04c2a90cf660445568cbcf01e83b9c
Author: Kathy Brade <brade@xxxxxxxxxxxxxxxxx>
Date:   Thu Oct 6 14:09:04 2016 -0400

    Bug 20304: SOCKS socket does not support spaces and other special characters
    
    Correctly decode file URL paths before using for them in
    Unix domain socket paths.
    
    The upstream bug is https://bugzilla.mozilla.org/show_bug.cgi?id=1308275.
---
 netwerk/socket/nsSOCKSIOLayer.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/netwerk/socket/nsSOCKSIOLayer.cpp b/netwerk/socket/nsSOCKSIOLayer.cpp
index b26408d..be69725 100644
--- a/netwerk/socket/nsSOCKSIOLayer.cpp
+++ b/netwerk/socket/nsSOCKSIOLayer.cpp
@@ -20,6 +20,8 @@
 #include "nsICancelable.h"
 #include "nsThreadUtils.h"
 #include "nsIURL.h"
+#include "nsIFile.h"
+#include "nsNetUtil.h"
 #include "mozilla/Logging.h"
 #include "mozilla/net/DNS.h"
 #include "mozilla/unused.h"
@@ -133,17 +135,15 @@ private:
         nsresult rv;
         MOZ_ASSERT(aProxyAddr);
 
-        nsCOMPtr<nsIURL> url = do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv);
+        nsCOMPtr<nsIFile> socketFile;
+        rv = NS_GetFileFromURLSpec(aDomainSocketPath,
+                                   getter_AddRefs(socketFile));
         if (NS_WARN_IF(NS_FAILED(rv))) {
             return rv;
         }
 
-        if (NS_WARN_IF(NS_FAILED(rv = url->SetSpec(aDomainSocketPath)))) {
-            return rv;
-        }
-
         nsAutoCString path;
-        if (NS_WARN_IF(NS_FAILED(rv = url->GetPath(path)))) {
+        if (NS_WARN_IF(NS_FAILED(rv = socketFile->GetNativePath(path)))) {
             return rv;
         }
 

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