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
b1aa9bf8
Commit
b1aa9bf8
authored
May 16, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
May 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Pass arguments as substrings to get_cookie_container.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5b98186a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
cookie.c
dlls/wininet/cookie.c
+9
-12
No files found.
dlls/wininet/cookie.c
View file @
b1aa9bf8
...
...
@@ -142,24 +142,22 @@ static cookie_domain_t *get_cookie_domain(substr_t domain, BOOL create)
}
}
static
cookie_container_t
*
get_cookie_container
(
const
WCHAR
*
domain
,
const
WCHAR
*
path
,
BOOL
create
)
static
cookie_container_t
*
get_cookie_container
(
substr_t
domain
,
substr_t
path
,
BOOL
create
)
{
cookie_domain_t
*
cookie_domain
;
cookie_container_t
*
cookie_container
,
*
iter
;
size_t
path_len
,
len
;
size_t
len
;
cookie_domain
=
get_cookie_domain
(
substrz
(
domain
)
,
create
);
cookie_domain
=
get_cookie_domain
(
domain
,
create
);
if
(
!
cookie_domain
)
return
NULL
;
path_len
=
strlenW
(
path
);
LIST_FOR_EACH_ENTRY
(
cookie_container
,
&
cookie_domain
->
path_list
,
cookie_container_t
,
entry
)
{
len
=
strlenW
(
cookie_container
->
path
);
if
(
len
<
path
_
len
)
if
(
len
<
path
.
len
)
break
;
if
(
!
strcmpiW
(
cookie_container
->
path
,
path
))
if
(
path
.
len
==
strlenW
(
cookie_container
->
path
)
&&
!
strncmpiW
(
cookie_container
->
path
,
path
.
str
,
path
.
len
))
return
cookie_container
;
}
...
...
@@ -170,7 +168,7 @@ static cookie_container_t *get_cookie_container(const WCHAR *domain, const WCHAR
if
(
!
cookie_container
)
return
NULL
;
cookie_container
->
path
=
heap_str
dupW
(
path
);
cookie_container
->
path
=
heap_str
ndupW
(
path
.
str
,
path
.
len
);
if
(
!
cookie_container
->
path
)
{
heap_free
(
cookie_container
);
return
NULL
;
...
...
@@ -179,9 +177,8 @@ static cookie_container_t *get_cookie_container(const WCHAR *domain, const WCHAR
cookie_container
->
domain
=
cookie_domain
;
list_init
(
&
cookie_container
->
cookie_list
);
LIST_FOR_EACH_ENTRY
(
iter
,
&
cookie_domain
->
path_list
,
cookie_container_t
,
entry
)
{
if
(
strlenW
(
iter
->
path
)
<=
path
_
len
)
{
if
(
strlenW
(
iter
->
path
)
<=
path
.
len
)
{
list_add_before
(
&
iter
->
entry
,
&
cookie_container
->
entry
);
return
cookie_container
;
}
...
...
@@ -341,7 +338,7 @@ static BOOL load_persistent_cookie(LPCWSTR domain, LPCWSTR path)
str
[
size
]
=
0
;
UnlockUrlCacheEntryStream
(
cookie
,
0
);
cookie_container
=
get_cookie_container
(
domain
,
path
,
TRUE
);
cookie_container
=
get_cookie_container
(
substrz
(
domain
),
substrz
(
path
)
,
TRUE
);
if
(
!
cookie_container
)
{
heap_free
(
str
);
return
FALSE
;
...
...
@@ -1043,7 +1040,7 @@ DWORD set_cookie(const WCHAR *domain, const WCHAR *path, const WCHAR *cookie_nam
load_persistent_cookie
(
domain
,
path
);
container
=
get_cookie_container
(
domain
,
path
,
!
expired
);
container
=
get_cookie_container
(
substrz
(
domain
),
substrz
(
path
)
,
!
expired
);
if
(
!
container
)
{
heap_free
(
data
);
if
(
value
!=
data
)
heap_free
(
value
);
...
...
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