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
8e90c609
Commit
8e90c609
authored
Sep 20, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Sep 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Don't crash accessing an invalid handle in GlobalSize.
parent
b095ade9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
heap.c
dlls/kernel32/heap.c
+5
-1
heap.c
dlls/kernel32/tests/heap.c
+7
-0
No files found.
dlls/kernel32/heap.c
View file @
8e90c609
...
...
@@ -807,7 +807,11 @@ SIZE_T WINAPI GlobalSize(HGLOBAL hmem)
DWORD
retval
;
PGLOBAL32_INTERN
pintern
;
if
(
!
hmem
)
return
0
;
if
(
!
((
ULONG_PTR
)
hmem
>>
16
))
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
0
;
}
if
(
ISPOINTER
(
hmem
))
{
...
...
dlls/kernel32/tests/heap.c
View file @
8e90c609
...
...
@@ -197,6 +197,13 @@ START_TEST(heap)
res
=
GlobalUnlock
(
gbl
);
ok
(
res
==
1
,
"Expected 1, got %d
\n
"
,
res
);
/* GlobalSize on an invalid handle */
SetLastError
(
MAGIC_DEAD
);
size
=
GlobalSize
((
HGLOBAL
)
0xc042
);
ok
(
size
==
0
,
"Expected 0, got %ld
\n
"
,
size
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
/* ####################################### */
/* Local*() functions */
gbl
=
LocalAlloc
(
LMEM_MOVEABLE
,
0
);
...
...
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