34 lines
1.2 KiB
Diff
34 lines
1.2 KiB
Diff
From bd28c4f6d37732480925ba56c72de8a223f9f993 Mon Sep 17 00:00:00 2001
|
|
From: Valentin Gosu <valentin.gosu@gmail.com>
|
|
Date: Thu, 19 Oct 2023 07:40:28 +0000 (8 months ago)
|
|
Subject: [PATCH] CVE-2023-6209
|
|
|
|
---
|
|
netwerk/base/nsStandardURL.cpp | 10 +++++++++-
|
|
1 file changed, 9 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp
|
|
index df4188b500..2c02ae59aa 100644
|
|
--- a/netwerk/base/nsStandardURL.cpp
|
|
+++ b/netwerk/base/nsStandardURL.cpp
|
|
@@ -2567,7 +2567,15 @@ nsStandardURL::Resolve(const nsACString& in, nsACString& out) {
|
|
// locate result path
|
|
resultPath = PL_strstr(result, "://");
|
|
if (resultPath) {
|
|
- resultPath = PL_strchr(resultPath + 3, '/');
|
|
+ // If there are multiple slashes after :// we must ignore them
|
|
+ // otherwise net_CoalesceDirs may think the host is a part of the path.
|
|
+ resultPath += 3;
|
|
+ if (protocol.IsEmpty() && Scheme() != "file") {
|
|
+ while (*resultPath == '/') {
|
|
+ resultPath++;
|
|
+ }
|
|
+ }
|
|
+ resultPath = strchr(resultPath, '/');
|
|
if (resultPath) {
|
|
net_CoalesceDirs(coalesceFlag, resultPath);
|
|
}
|
|
--
|
|
2.33.0
|
|
|