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
694a0928
Commit
694a0928
authored
May 18, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
May 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Fix buffer size query for HttpQueryInfo(HTTP_QUERY_RAW_HEADERS_CRLF).
parent
b11156b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
http.c
dlls/wininet/http.c
+8
-9
http.c
dlls/wininet/tests/http.c
+6
-1
No files found.
dlls/wininet/http.c
View file @
694a0928
...
...
@@ -2197,27 +2197,26 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
{
LPWSTR
headers
;
DWORD
len
;
BOOL
ret
;
BOOL
ret
=
FALSE
;
if
(
request_only
)
headers
=
HTTP_BuildHeaderRequestString
(
lpwhr
,
lpwhr
->
lpszVerb
,
lpwhr
->
lpszPath
,
lpwhr
->
lpszVersion
);
else
headers
=
lpwhr
->
lpszRawHeaders
;
len
=
strlenW
(
headers
);
if
(
len
+
1
>
*
lpdwBufferLength
/
sizeof
(
WCHAR
)
)
len
=
(
strlenW
(
headers
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
len
>
*
lpdwBufferLength
)
{
*
lpdwBufferLength
=
(
len
+
1
)
*
sizeof
(
WCHAR
);
INTERNET_SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
ret
=
FALSE
;
}
else
}
else
if
(
lpBuffer
)
{
memcpy
(
lpBuffer
,
headers
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
*
lpdwBufferLength
=
len
*
sizeof
(
WCHAR
);
TRACE
(
"returning data: %s
\n
"
,
debugstr_wn
((
WCHAR
*
)
lpBuffer
,
len
));
memcpy
(
lpBuffer
,
headers
,
len
);
TRACE
(
"returning data: %s
\n
"
,
debugstr_wn
(
lpBuffer
,
len
/
sizeof
(
WCHAR
)));
ret
=
TRUE
;
}
*
lpdwBufferLength
=
len
;
if
(
request_only
)
HeapFree
(
GetProcessHeap
(),
0
,
headers
);
...
...
dlls/wininet/tests/http.c
View file @
694a0928
...
...
@@ -1848,10 +1848,15 @@ static void test_open_url_async(void)
type
=
0
;
size
=
sizeof
(
type
);
ret
=
InternetQueryOption
(
ctx
.
req
,
INTERNET_OPTION_HANDLE_TYPE
,
&
type
,
&
size
);
ok
(
ret
,
"
HttpQueryInfo
failed: %u
\n
"
,
GetLastError
());
ok
(
ret
,
"
InternetQueryOption
failed: %u
\n
"
,
GetLastError
());
ok
(
type
==
INTERNET_HANDLE_TYPE_HTTP_REQUEST
,
"expected INTERNET_HANDLE_TYPE_HTTP_REQUEST, got %u
\n
"
,
type
);
size
=
0
;
ret
=
HttpQueryInfo
(
ctx
.
req
,
HTTP_QUERY_RAW_HEADERS_CRLF
,
NULL
,
&
size
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"HttpQueryInfo failed
\n
"
);
ok
(
size
>
0
,
"expected size > 0
\n
"
);
CloseHandle
(
ctx
.
event
);
InternetCloseHandle
(
ctx
.
req
);
InternetCloseHandle
(
ses
);
...
...
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