Below is the patch that should resolve the issue. Let me know if it works for you.
If you installed via a package manager, it will be part of 1.4.17.
diff --git src/http/httpreq.cpp src/http/httpreq.cpp
index 0194162..6d175e1 100644
--- src/http/httpreq.cpp
+++ src/http/httpreq.cpp
@@ -81,7 +81,7 @@ static char *escape_uri(char *p, char *pEnd, const char *pURI, int uriLen)
{
const char *pURIEnd = pURI + uriLen;
char ch;
- while ((pURI < pURIEnd) && (p < pEnd - 3))
+ while ((pURI < pURIEnd) && (p < pEnd))
{
ch = *pURI++;
if (isalnum(ch))
@@ -106,6 +106,8 @@ static char *escape_uri(char *p, char *pEnd, const char *pURI, int uriLen)
*p++ = ch;
break;
default:
+ if (p >= pEnd - 3)
+ break;
*p++ = '%';
*p++ = s_hex[((unsigned char)ch) >> 4 ];
*p++ = s_hex[ ch & 0xf ];
diff --git src/http/httpsession.cpp src/http/httpsession.cpp
index 720ad6b..7fe4001 100644
--- src/http/httpsession.cpp
+++ src/http/httpsession.cpp
@@ -1328,6 +1328,10 @@ int HttpSession::processVHostRewrite()
m_sessionHooks.reset();
m_sessionHooks.inherit(((HttpContext *)pContext)->getSessionHooks(), 0);
m_pModuleConfig = ((HttpContext *)pContext)->getModuleConfig();
+ if (ret == -2) {
+ m_processState = HSPS_BEGIN_HANDLER_PROCESS;
+ return 0;
+ }
}
}
m_processState = HSPS_CONTEXT_MAP;