File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- /*
1+ /*
22* ModSecurity for Apache 2.x, http://www.modsecurity.org/
33* Copyright (c) 2004-2011 Trustwave Holdings, Inc. (http://www.trustwave.com/)
44*
@@ -796,8 +796,8 @@ CMyHttpModule::OnBeginRequest(
796796
797797 HTTP_REQUEST *req = pRequest->GetRawHttpRequest ();
798798
799- r->hostname = ConvertUTF16ToUTF8 (req->CookedUrl .pHost , req->CookedUrl .HostLength , r->pool );
800- r->path_info = ConvertUTF16ToUTF8 (req->CookedUrl .pAbsPath , req->CookedUrl .AbsPathLength , r->pool );
799+ r->hostname = ConvertUTF16ToUTF8 (req->CookedUrl .pHost , req->CookedUrl .HostLength / sizeof (WCHAR) , r->pool );
800+ r->path_info = ConvertUTF16ToUTF8 (req->CookedUrl .pAbsPath , req->CookedUrl .AbsPathLength / sizeof (WCHAR) , r->pool );
801801
802802 if (r->hostname == NULL )
803803 {
@@ -825,8 +825,8 @@ CMyHttpModule::OnBeginRequest(
825825 }
826826 }
827827
828- if (req->CookedUrl .pQueryString != NULL )
829- r->args = ConvertUTF16ToUTF8 (req->CookedUrl .pQueryString + 1 , req->CookedUrl .QueryStringLength - 1 , r->pool );
828+ if (req->CookedUrl .pQueryString != NULL && req-> CookedUrl . QueryStringLength > 0 )
829+ r->args = ConvertUTF16ToUTF8 (req->CookedUrl .pQueryString + 1 , ( req->CookedUrl .QueryStringLength / sizeof (WCHAR)) - 1 , r->pool );
830830
831831#define _TRANSHEADER (id,str ) if (req->Headers.KnownHeaders[id].pRawValue != NULL ) \
832832 {\
You can’t perform that action at this time.
0 commit comments