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
6a84877c
Commit
6a84877c
authored
Aug 09, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Pass a length to parse_header().
parent
57955c73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
request.c
dlls/winhttp/request.c
+9
-6
No files found.
dlls/winhttp/request.c
View file @
6a84877c
...
...
@@ -286,7 +286,7 @@ static BOOL valid_token_char( WCHAR c )
}
}
static
struct
header
*
parse_header
(
const
WCHAR
*
string
)
static
struct
header
*
parse_header
(
const
WCHAR
*
string
,
size_t
string_len
)
{
const
WCHAR
*
p
,
*
q
;
struct
header
*
header
;
...
...
@@ -324,7 +324,7 @@ static struct header *parse_header( const WCHAR *string )
q
++
;
/* skip past colon */
while
(
*
q
==
' '
)
q
++
;
len
=
lstrlenW
(
q
)
;
len
=
(
string
+
string_len
)
-
q
;
if
(
!
(
header
->
value
=
malloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
...
...
@@ -467,15 +467,17 @@ DWORD add_request_headers( struct request *request, const WCHAR *headers, DWORD
p
=
buffer
;
do
{
const
WCHAR
*
end
;
if
(
!*
p
)
break
;
for
(
q
=
p
;
*
q
&&
*
q
!=
'\r'
&&
*
q
!=
'\n'
;
++
q
)
;
*
q
++
=
0
;
end
=
q
;
while
(
*
q
==
'\r'
||
*
q
==
'\n'
)
++
q
;
if
((
header
=
parse_header
(
p
)))
if
((
header
=
parse_header
(
p
,
end
-
p
)))
{
ret
=
process_header
(
request
,
header
->
field
,
header
->
value
,
flags
,
TRUE
);
free_header
(
header
);
...
...
@@ -2559,6 +2561,7 @@ static DWORD read_reply( struct request *request )
for
(;;)
{
struct
header
*
header
;
int
lenW
;
buflen
=
MAX_REPLY_LEN
;
if
(
read_line
(
request
,
buffer
,
&
buflen
))
return
ERROR_SUCCESS
;
...
...
@@ -2576,9 +2579,9 @@ static DWORD read_reply( struct request *request )
memcpy
(
raw_headers
+
offset
,
L"
\r\n
"
,
sizeof
(
L"
\r\n
"
)
);
break
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
buffer
,
buflen
,
raw_headers
+
offset
,
buflen
);
lenW
=
MultiByteToWideChar
(
CP_ACP
,
0
,
buffer
,
buflen
,
raw_headers
+
offset
,
buflen
);
if
(
!
(
header
=
parse_header
(
raw_headers
+
offset
)))
break
;
if
(
!
(
header
=
parse_header
(
raw_headers
+
offset
,
lenW
-
1
)))
break
;
if
((
ret
=
process_header
(
request
,
header
->
field
,
header
->
value
,
WINHTTP_ADDREQ_FLAG_ADD
,
FALSE
)))
{
free_header
(
header
);
...
...
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