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
4a8f4f28
Commit
4a8f4f28
authored
Oct 26, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Avoid accessing uninitialized memory.
Found by valgrind.
parent
621230fd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
cookie.c
dlls/wininet/cookie.c
+14
-9
No files found.
dlls/wininet/cookie.c
View file @
4a8f4f28
...
@@ -163,7 +163,6 @@ static cookie_domain *COOKIE_addDomain(LPCWSTR domain, LPCWSTR path)
...
@@ -163,7 +163,6 @@ static cookie_domain *COOKIE_addDomain(LPCWSTR domain, LPCWSTR path)
static
BOOL
COOKIE_crackUrlSimple
(
LPCWSTR
lpszUrl
,
LPWSTR
hostName
,
int
hostNameLen
,
LPWSTR
path
,
int
pathLen
)
static
BOOL
COOKIE_crackUrlSimple
(
LPCWSTR
lpszUrl
,
LPWSTR
hostName
,
int
hostNameLen
,
LPWSTR
path
,
int
pathLen
)
{
{
URL_COMPONENTSW
UrlComponents
;
URL_COMPONENTSW
UrlComponents
;
BOOL
rc
;
UrlComponents
.
lpszExtraInfo
=
NULL
;
UrlComponents
.
lpszExtraInfo
=
NULL
;
UrlComponents
.
lpszPassword
=
NULL
;
UrlComponents
.
lpszPassword
=
NULL
;
...
@@ -178,22 +177,28 @@ static BOOL COOKIE_crackUrlSimple(LPCWSTR lpszUrl, LPWSTR hostName, int hostName
...
@@ -178,22 +177,28 @@ static BOOL COOKIE_crackUrlSimple(LPCWSTR lpszUrl, LPWSTR hostName, int hostName
UrlComponents
.
dwHostNameLength
=
hostNameLen
;
UrlComponents
.
dwHostNameLength
=
hostNameLen
;
UrlComponents
.
dwUrlPathLength
=
pathLen
;
UrlComponents
.
dwUrlPathLength
=
pathLen
;
rc
=
InternetCrackUrlW
(
lpszUrl
,
0
,
0
,
&
UrlComponents
)
;
if
(
!
InternetCrackUrlW
(
lpszUrl
,
0
,
0
,
&
UrlComponents
))
return
FALSE
;
/* discard the webpage off the end of the path */
/* discard the webpage off the end of the path */
if
(
pathLen
>
0
&&
path
[
pathLen
-
1
]
!=
'/'
)
if
(
UrlComponents
.
dwUrlPathLength
)
{
{
LPWSTR
ptr
;
if
(
path
[
UrlComponents
.
dwUrlPathLength
-
1
]
!=
'/'
)
ptr
=
strrchrW
(
path
,
'/'
);
{
if
(
ptr
)
WCHAR
*
ptr
;
*
(
++
ptr
)
=
0
;
if
((
ptr
=
strrchrW
(
path
,
'/'
)))
*
(
++
ptr
)
=
0
;
else
else
{
{
path
[
0
]
=
'/'
;
path
[
0
]
=
'/'
;
path
[
1
]
=
0
;
path
[
1
]
=
0
;
}
}
}
}
return
rc
;
}
else
if
(
pathLen
>=
2
)
{
path
[
0
]
=
'/'
;
path
[
1
]
=
0
;
}
return
TRUE
;
}
}
/* match a domain. domain must match if the domain is not NULL. path must match if the path is not NULL */
/* match a domain. domain must match if the domain is not NULL. path must match if the path is not NULL */
...
@@ -569,7 +574,7 @@ BOOL WINAPI InternetSetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
...
@@ -569,7 +574,7 @@ BOOL WINAPI InternetSetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
return
FALSE
;
return
FALSE
;
}
}
hostName
[
0
]
=
path
[
0
]
=
0
;
hostName
[
0
]
=
0
;
ret
=
COOKIE_crackUrlSimple
(
lpszUrl
,
hostName
,
sizeof
(
hostName
)
/
sizeof
(
hostName
[
0
]),
path
,
sizeof
(
path
)
/
sizeof
(
path
[
0
]));
ret
=
COOKIE_crackUrlSimple
(
lpszUrl
,
hostName
,
sizeof
(
hostName
)
/
sizeof
(
hostName
[
0
]),
path
,
sizeof
(
path
)
/
sizeof
(
path
[
0
]));
if
(
!
ret
||
!
hostName
[
0
])
return
FALSE
;
if
(
!
ret
||
!
hostName
[
0
])
return
FALSE
;
...
...
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