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
5caf8094
Commit
5caf8094
authored
Jun 04, 2009
by
Eric van Beurden
Committed by
Alexandre Julliard
Jun 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Check for bad allocation in HeapReAlloc.
parent
80dd9b9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
http.c
dlls/wininet/http.c
+7
-6
No files found.
dlls/wininet/http.c
View file @
5caf8094
...
...
@@ -4160,6 +4160,7 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear)
LPWSTR
status_code
,
status_text
;
DWORD
cchMaxRawHeaders
=
1024
;
LPWSTR
lpszRawHeaders
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
cchMaxRawHeaders
+
1
)
*
sizeof
(
WCHAR
));
LPWSTR
temp
;
DWORD
cchRawHeaders
=
0
;
TRACE
(
"-->
\n
"
);
...
...
@@ -4213,10 +4214,10 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear)
/* regenerate raw headers */
while
(
cchRawHeaders
+
buflen
+
strlenW
(
szCrLf
)
>
cchMaxRawHeaders
)
{
cchMaxRawHeaders
*=
2
;
lpszRawHeaders
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
lpszRawHeaders
,
(
cchMaxRawHeaders
+
1
)
*
sizeof
(
WCHAR
));
}
temp
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
lpszRawHeaders
,
(
cchMaxRawHeaders
+
1
)
*
sizeof
(
WCHAR
));
if
(
temp
==
NULL
)
goto
lend
;
lpszRawHeaders
=
temp
;
memcpy
(
lpszRawHeaders
+
cchRawHeaders
,
buffer
,
(
buflen
-
1
)
*
sizeof
(
WCHAR
));
cchRawHeaders
+=
(
buflen
-
1
);
memcpy
(
lpszRawHeaders
+
cchRawHeaders
,
szCrLf
,
sizeof
(
szCrLf
));
...
...
@@ -4242,10 +4243,10 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear)
MultiByteToWideChar
(
CP_ACP
,
0
,
bufferA
,
buflen
,
buffer
,
MAX_REPLY_LEN
);
while
(
cchRawHeaders
+
buflen
+
strlenW
(
szCrLf
)
>
cchMaxRawHeaders
)
{
cchMaxRawHeaders
*=
2
;
lpszRawHeaders
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
lpszRawHeaders
,
(
cchMaxRawHeaders
+
1
)
*
sizeof
(
WCHAR
));
}
temp
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
lpszRawHeaders
,
(
cchMaxRawHeaders
+
1
)
*
sizeof
(
WCHAR
));
if
(
temp
==
NULL
)
goto
lend
;
lpszRawHeaders
=
temp
;
memcpy
(
lpszRawHeaders
+
cchRawHeaders
,
buffer
,
(
buflen
-
1
)
*
sizeof
(
WCHAR
));
cchRawHeaders
+=
(
buflen
-
1
);
memcpy
(
lpszRawHeaders
+
cchRawHeaders
,
szCrLf
,
sizeof
(
szCrLf
));
...
...
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