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
6b107c7f
Commit
6b107c7f
authored
Sep 09, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Reject NULL path in IShellLink_SetPath.
parent
fffb41f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
shelllink.c
dlls/shell32/shelllink.c
+4
-0
shelllink.c
dlls/shell32/tests/shelllink.c
+6
-0
No files found.
dlls/shell32/shelllink.c
View file @
6b107c7f
...
...
@@ -1651,6 +1651,8 @@ static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile)
TRACE
(
"(%p)->(path=%s)
\n
"
,
This
,
pszFile
);
if
(
!
pszFile
)
return
E_INVALIDARG
;
str
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pszFile
);
if
(
!
str
)
return
E_OUTOFMEMORY
;
...
...
@@ -2168,6 +2170,8 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
TRACE
(
"(%p)->(path=%s)
\n
"
,
This
,
debugstr_w
(
pszFile
));
if
(
!
pszFile
)
return
E_INVALIDARG
;
/* quotes at the ends of the string are stripped */
len
=
lstrlenW
(
pszFile
);
if
(
pszFile
[
0
]
==
'"'
&&
pszFile
[
len
-
1
]
==
'"'
)
...
...
dlls/shell32/tests/shelllink.c
View file @
6b107c7f
...
...
@@ -156,6 +156,9 @@ static void test_get_set(void)
ok
(
SUCCEEDED
(
r
),
"GetPath failed (0x%08x)
\n
"
,
r
);
ok
(
*
buffer
==
'\0'
,
"GetPath returned '%s'
\n
"
,
buffer
);
r
=
IShellLinkA_SetPath
(
sl
,
NULL
);
ok
(
r
==
E_INVALIDARG
,
"SetPath failed (0x%08x)
\n
"
,
r
);
r
=
IShellLinkA_SetPath
(
sl
,
""
);
ok
(
r
==
S_OK
,
"SetPath failed (0x%08x)
\n
"
,
r
);
...
...
@@ -700,6 +703,9 @@ static void test_datalink(void)
ok
(
r
==
E_FAIL
,
"CopyDataBlock failed
\n
"
);
ok
(
dar
==
NULL
,
"should be null
\n
"
);
r
=
IShellLinkW_SetPath
(
sl
,
NULL
);
ok
(
r
==
E_INVALIDARG
,
"set path failed
\n
"
);
r
=
IShellLinkW_SetPath
(
sl
,
lnk
);
ok
(
r
==
S_OK
,
"set path failed
\n
"
);
...
...
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