Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bc9e214f
Commit
bc9e214f
authored
Aug 27, 2008
by
Lei Zhang
Committed by
Alexandre Julliard
Aug 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Work around NULL headers when handling HTTP_QUERY_RAW_HEADERS_CRLF.
parent
faf9c55e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
http.c
dlls/wininet/http.c
+12
-3
http.c
dlls/wininet/tests/http.c
+10
-0
No files found.
dlls/wininet/http.c
View file @
bc9e214f
...
...
@@ -2187,15 +2187,18 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
case
HTTP_QUERY_RAW_HEADERS_CRLF
:
{
LPWSTR
headers
;
DWORD
len
;
DWORD
len
=
0
;
BOOL
ret
=
FALSE
;
static
const
WCHAR
CRLF
[]
=
{
'\r'
,
'\n'
,
0
};
if
(
request_only
)
headers
=
HTTP_BuildHeaderRequestString
(
lpwhr
,
lpwhr
->
lpszVerb
,
lpwhr
->
lpszPath
,
lpwhr
->
lpszVersion
);
else
headers
=
lpwhr
->
lpszRawHeaders
;
len
=
strlenW
(
headers
)
*
sizeof
(
WCHAR
);
if
(
headers
)
len
=
strlenW
(
headers
)
*
sizeof
(
WCHAR
);
if
(
len
+
sizeof
(
WCHAR
)
>
*
lpdwBufferLength
)
{
len
+=
sizeof
(
WCHAR
);
...
...
@@ -2204,7 +2207,13 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
}
else
if
(
lpBuffer
)
{
memcpy
(
lpBuffer
,
headers
,
len
+
sizeof
(
WCHAR
));
if
(
headers
)
memcpy
(
lpBuffer
,
headers
,
len
+
sizeof
(
WCHAR
));
else
{
len
=
strlenW
(
CRLF
)
*
sizeof
(
WCHAR
);
memcpy
(
lpBuffer
,
CRLF
,
sizeof
(
CRLF
));
}
TRACE
(
"returning data: %s
\n
"
,
debugstr_wn
(
lpBuffer
,
len
/
sizeof
(
WCHAR
)));
ret
=
TRUE
;
}
...
...
dlls/wininet/tests/http.c
View file @
bc9e214f
...
...
@@ -1208,6 +1208,16 @@ static void HttpHeaders_test(void)
/* end of W version tests */
/* Without HTTP_QUERY_FLAG_REQUEST_HEADERS */
index
=
0
;
len
=
sizeof
(
buffer
);
memset
(
buffer
,
'x'
,
sizeof
(
buffer
));
ok
(
HttpQueryInfo
(
hRequest
,
HTTP_QUERY_RAW_HEADERS_CRLF
,
buffer
,
&
len
,
&
index
)
==
TRUE
,
"Query failed
\n
"
);
ok
(
len
==
2
,
"Expected 2, got %d
\n
"
,
len
);
ok
(
strcmp
(
buffer
,
"
\r\n
"
)
==
0
,
"Expected CRLF, got '%s'
\n
"
,
buffer
);
ok
(
index
==
0
,
"Index was incremented
\n
"
);
ok
(
HttpAddRequestHeaders
(
hRequest
,
"Warning:test2"
,
-
1
,
HTTP_ADDREQ_FLAG_ADD
),
"Failed to add duplicate header using HTTP_ADDREQ_FLAG_ADD
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment