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
9256017a
Commit
9256017a
authored
Jan 28, 2018
by
Bernhard Übelacker
Committed by
Alexandre Julliard
Jan 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Validate DIB offset in CURSORICON_GetFileEntry.
Signed-off-by:
Bernhard Übelacker
<
bernhardu@mailbox.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
318edcc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
cursoricon.c
dlls/user32/cursoricon.c
+1
-0
cursoricon.c
dlls/user32/tests/cursoricon.c
+8
-0
No files found.
dlls/user32/cursoricon.c
View file @
9256017a
...
...
@@ -678,6 +678,7 @@ static BOOL CURSORICON_GetFileEntry( LPCVOID dir, DWORD size, int n,
if
((
const
char
*
)
&
filedir
->
idEntries
[
n
+
1
]
-
(
const
char
*
)
dir
>
size
)
return
FALSE
;
entry
=
&
filedir
->
idEntries
[
n
];
if
(
entry
->
dwDIBOffset
>
size
-
sizeof
(
info
->
biSize
))
return
FALSE
;
info
=
(
const
BITMAPINFOHEADER
*
)((
const
char
*
)
dir
+
entry
->
dwDIBOffset
);
if
(
info
->
biSize
!=
sizeof
(
BITMAPCOREHEADER
))
{
...
...
dlls/user32/tests/cursoricon.c
View file @
9256017a
...
...
@@ -1031,6 +1031,12 @@ static const unsigned char gif4pixel[42] = {
0x02
,
0x00
,
0x00
,
0x02
,
0x03
,
0x14
,
0x16
,
0x05
,
0x00
,
0x3b
};
/* An invalid cursor with an invalid dwDIBOffset */
static
const
unsigned
char
invalid_dwDIBOffset
[]
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0x00
,
0x00
};
static
const
DWORD
biSize_tests
[]
=
{
0
,
sizeof
(
BITMAPCOREHEADER
)
-
1
,
...
...
@@ -1320,6 +1326,8 @@ static void test_LoadImage(void)
test_LoadImageFile
(
"BMP (broken biSize)"
,
bmpimage
,
sizeof
(
bmpimage
),
"bmp"
,
0
);
}
bitmap_header
->
biSize
=
sizeof
(
BITMAPINFOHEADER
);
test_LoadImageFile
(
"Cursor (invalid dwDIBOffset)"
,
invalid_dwDIBOffset
,
sizeof
(
invalid_dwDIBOffset
),
"cur"
,
0
);
}
#undef ARRAY_SIZE
...
...
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