From df7c2aac6471308fe24a7b31a29b43459db6ffc2 Mon Sep 17 00:00:00 2001
From: "cheng.hm" <cheng.hm@asiainfo-sec.com>
Date: Thu, 21 Apr 2022 01:30:03 -0700
Subject: [PATCH 1/2] impossible scheme

---
 src/transaction.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/transaction.cc b/src/transaction.cc
index 96f9c21b34..eba7b6fb42 100644
--- a/src/transaction.cc
+++ b/src/transaction.cc
@@ -522,7 +522,7 @@ int Transaction::processURI(const char *uri, const char *method,
     if (!m_uri_decoded.empty() && m_uri_decoded.at(0) != '/') {
         bool fullDomain = true;
         size_t scheme = m_uri_decoded.find(":")+1;
-        if (scheme == std::string::npos) {
+        if (scheme == std::string::npos) { //impossible case, for +1 in size_t scheme = m_uri_decoded.find(":")+1
             fullDomain = false;
         }
         // Searching with a pos of -1 is undefined we also shortcut

From ff652715548d7c5c4b4f7a000141936193172666 Mon Sep 17 00:00:00 2001
From: "cheng.hm" <cheng.hm@asiainfo-sec.com>
Date: Thu, 21 Apr 2022 01:45:33 -0700
Subject: [PATCH 2/2] backup

---
 src/transaction.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/transaction.cc b/src/transaction.cc
index eba7b6fb42..1cb380b764 100644
--- a/src/transaction.cc
+++ b/src/transaction.cc
@@ -528,8 +528,8 @@ int Transaction::processURI(const char *uri, const char *method,
         // Searching with a pos of -1 is undefined we also shortcut
         if (scheme != std::string::npos && fullDomain == true) {
             // Assuming we found a colon make sure its followed
-            size_t netloc = m_uri_decoded.find("//", scheme) + 2;
-            if (netloc == std::string::npos || (netloc != scheme + 2)) {
+            size_t netloc = m_uri_decoded.find("//", scheme) + 2;//
+            if (netloc == std::string::npos || (netloc != scheme + 2)) { //(netloc == std::string::npos) will be false forever, for +2 in size_t netloc = m_uri_decoded.find("//", scheme) + 2
                 fullDomain = false;
             }
             if (netloc != std::string::npos && fullDomain == true) {