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
5bdcd79c
Commit
5bdcd79c
authored
Dec 07, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Dec 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shdocvw: Correct misuse of output pointer in get_profile_string helper.
parent
1c510150
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
intshcut.c
dlls/shdocvw/intshcut.c
+25
-16
No files found.
dlls/shdocvw/intshcut.c
View file @
5bdcd79c
...
...
@@ -416,23 +416,32 @@ static DWORD get_profile_string(LPCWSTR lpAppName, LPCWSTR lpKeyName,
LPCWSTR
lpFileName
,
WCHAR
**
rString
)
{
DWORD
r
=
0
;
DWORD
len
=
128
;
DWORD
len
=
128
;
WCHAR
*
buffer
;
*
rString
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
rString
!=
NULL
)
buffer
=
CoTaskMemAlloc
(
len
*
sizeof
(
*
buffer
));
if
(
buffer
!=
NULL
)
{
r
=
GetPrivateProfileStringW
(
lpAppName
,
lpKeyName
,
NULL
,
*
rString
,
len
,
lpFileName
);
r
=
GetPrivateProfileStringW
(
lpAppName
,
lpKeyName
,
NULL
,
buffer
,
len
,
lpFileName
);
while
(
r
==
len
-
1
)
{
CoTaskMemFree
(
rString
);
WCHAR
*
realloc_buf
;
len
*=
2
;
rString
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
rString
==
NULL
)
break
;
r
=
GetPrivateProfileStringW
(
lpAppName
,
lpKeyName
,
NULL
,
*
rString
,
len
,
lpFileName
);
realloc_buf
=
CoTaskMemRealloc
(
buffer
,
len
*
sizeof
(
*
buffer
));
if
(
realloc_buf
==
NULL
)
{
CoTaskMemFree
(
buffer
);
*
rString
=
NULL
;
return
0
;
}
buffer
=
realloc_buf
;
r
=
GetPrivateProfileStringW
(
lpAppName
,
lpKeyName
,
NULL
,
buffer
,
len
,
lpFileName
);
}
}
*
rString
=
buffer
;
return
r
;
}
...
...
@@ -456,12 +465,17 @@ static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileNam
r
=
get_profile_string
(
str_header
,
str_URL
,
pszFileName
,
&
url
);
if
(
r
==
0
)
if
(
url
==
NULL
)
{
hr
=
E_OUTOFMEMORY
;
CoTaskMemFree
(
filename
);
}
else
if
(
r
==
0
)
{
hr
=
E_FAIL
;
CoTaskMemFree
(
filename
);
}
else
if
(
url
!=
NULL
)
else
{
hr
=
S_OK
;
CoTaskMemFree
(
This
->
currentFile
);
...
...
@@ -470,11 +484,6 @@ static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileNam
This
->
url
=
url
;
This
->
isDirty
=
FALSE
;
}
else
{
hr
=
E_OUTOFMEMORY
;
CoTaskMemFree
(
filename
);
}
/* Now we're going to read in the iconfile and iconindex.
If we don't find them, that's not a failure case -- it's possible
...
...
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