Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f0ce7208
Commit
f0ce7208
authored
Jun 24, 2009
by
Eric van Beurden
Committed by
Alexandre Julliard
Jun 25, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Check for failed heap allocations.
parent
42c7dc94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
cookie.c
dlls/wininet/cookie.c
+14
-0
No files found.
dlls/wininet/cookie.c
View file @
f0ce7208
...
...
@@ -453,6 +453,12 @@ static BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWST
BOOL
expired
=
FALSE
;
value
=
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
cookie_data
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
data
==
NULL
)
{
ERR
(
"could not allocate %zu bytes for the cookie data buffer
\n
"
,
(
strlenW
(
cookie_data
)
+
1
)
*
sizeof
(
WCHAR
));
return
FALSE
;
}
strcpyW
(
data
,
cookie_data
);
memset
(
&
expiry
,
0
,
sizeof
(
expiry
));
...
...
@@ -470,7 +476,15 @@ static BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWST
if
(
!
(
ptr
=
strchrW
(
ptr
,
';'
)))
break
;
*
ptr
++
=
0
;
if
(
value
!=
data
)
HeapFree
(
GetProcessHeap
(),
0
,
value
);
value
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
ptr
-
data
)
*
sizeof
(
WCHAR
));
if
(
value
==
NULL
)
{
HeapFree
(
GetProcessHeap
(),
0
,
data
);
ERR
(
"could not allocate %zu bytes for the cookie value buffer
\n
"
,
(
ptr
-
data
)
*
sizeof
(
WCHAR
));
return
FALSE
;
}
strcpyW
(
value
,
data
);
while
(
*
ptr
==
' '
)
ptr
++
;
/* whitespace */
...
...
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