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
da605a93
Commit
da605a93
authored
Oct 03, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Oct 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptnet: Don't access URL cache entry before it's been read.
parent
f50b2c23
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
cryptnet_main.c
dlls/cryptnet/cryptnet_main.c
+22
-17
No files found.
dlls/cryptnet/cryptnet_main.c
View file @
da605a93
...
...
@@ -405,28 +405,29 @@ static BOOL CRYPT_GetObjectFromCache(LPCWSTR pszURL, PCRYPT_BLOB_ARRAY pObject,
PCRYPT_RETRIEVE_AUX_INFO
pAuxInfo
)
{
BOOL
ret
=
FALSE
;
INTERNET_CACHE_ENTRY_INFOW
cacheInfo
=
{
sizeof
(
cacheInfo
),
0
}
;
DWORD
size
=
sizeof
(
cacheInfo
)
;
INTERNET_CACHE_ENTRY_INFOW
*
pCacheInfo
=
NULL
;
DWORD
size
=
0
;
TRACE
(
"(%s, %p, %p)
\n
"
,
debugstr_w
(
pszURL
),
pObject
,
pAuxInfo
);
if
(
GetUrlCacheEntryInfoW
(
pszURL
,
&
cacheInfo
,
&
size
)
||
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
)
ret
=
GetUrlCacheEntryInfoW
(
pszURL
,
NULL
,
&
size
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
)
{
pCacheInfo
=
CryptMemAlloc
(
size
);
if
(
pCacheInfo
)
ret
=
TRUE
;
else
SetLastError
(
ERROR_OUTOFMEMORY
);
}
if
(
ret
&&
(
ret
=
GetUrlCacheEntryInfoW
(
pszURL
,
pCacheInfo
,
&
size
)))
{
FILETIME
ft
;
GetSystemTimeAsFileTime
(
&
ft
);
if
(
CompareFileTime
(
&
cacheInfo
.
ExpireTime
,
&
ft
)
>=
0
)
{
LPINTERNET_CACHE_ENTRY_INFOW
pCacheInfo
=
CryptMemAlloc
(
size
);
if
(
pCacheInfo
)
{
if
(
GetUrlCacheEntryInfoW
(
pszURL
,
pCacheInfo
,
&
size
))
if
(
CompareFileTime
(
&
pCacheInfo
->
ExpireTime
,
&
ft
)
>=
0
)
{
HANDLE
hFile
=
CreateFileW
(
pCacheInfo
->
lpszLocalFileName
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hFile
!=
INVALID_HANDLE_VALUE
)
{
...
...
@@ -442,15 +443,19 @@ static BOOL CRYPT_GetObjectFromCache(LPCWSTR pszURL, PCRYPT_BLOB_ARRAY pObject,
}
CloseHandle
(
hFile
);
}
}
CryptMemFree
(
pCacheInfo
);
}
else
SetLastError
(
ERROR_OUTOFMEMORY
);
{
DeleteUrlCacheEntryW
(
pszURL
);
ret
=
FALSE
;
}
}
else
{
DeleteUrlCacheEntryW
(
pszURL
);
ret
=
FALSE
;
}
}
CryptMemFree
(
pCacheInfo
);
TRACE
(
"returning %d
\n
"
,
ret
);
return
ret
;
}
...
...
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