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
0ef705fb
Commit
0ef705fb
authored
Jul 07, 2012
by
Marcus Meissner
Committed by
Alexandre Julliard
Jul 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Avoid memcmp result truncation (Coverity).
parent
a181e4df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
recyclebin.c
dlls/shell32/recyclebin.c
+8
-1
No files found.
dlls/shell32/recyclebin.c
View file @
0ef705fb
...
...
@@ -457,12 +457,19 @@ static HRESULT WINAPI RecycleBin_BindToStorage(IShellFolder2 *This, LPCITEMIDLIS
static
HRESULT
WINAPI
RecycleBin_CompareIDs
(
IShellFolder2
*
iface
,
LPARAM
lParam
,
LPCITEMIDLIST
pidl1
,
LPCITEMIDLIST
pidl2
)
{
RecycleBin
*
This
=
impl_from_IShellFolder2
(
iface
);
int
ret
;
/* TODO */
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
This
,
(
void
*
)
lParam
,
pidl1
,
pidl2
);
if
(
pidl1
->
mkid
.
cb
!=
pidl2
->
mkid
.
cb
)
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
pidl1
->
mkid
.
cb
-
pidl2
->
mkid
.
cb
);
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
(
unsigned
short
)
memcmp
(
pidl1
->
mkid
.
abID
,
pidl2
->
mkid
.
abID
,
pidl1
->
mkid
.
cb
));
/* Looks too complicated, but in optimized memcpy we might get
* a 32bit wide difference and would truncate it to 16 bit, so
* erroneously returning equality. */
ret
=
memcmp
(
pidl1
->
mkid
.
abID
,
pidl2
->
mkid
.
abID
,
pidl1
->
mkid
.
cb
);
if
(
ret
<
0
)
ret
=
-
1
;
if
(
ret
>
0
)
ret
=
1
;
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
(
unsigned
short
)
ret
);
}
static
HRESULT
WINAPI
RecycleBin_CreateViewObject
(
IShellFolder2
*
iface
,
HWND
hwndOwner
,
REFIID
riid
,
void
**
ppv
)
...
...
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