Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
761391f1
Commit
761391f1
authored
Nov 13, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add a check for passed buffer size to GdipGetRegionData.
parent
8dc170e2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
region.c
dlls/gdiplus/region.c
+11
-1
region.c
dlls/gdiplus/tests/region.c
+0
-3
No files found.
dlls/gdiplus/region.c
View file @
761391f1
...
...
@@ -828,12 +828,22 @@ GpStatus WINGDIPAPI GdipGetRegionData(GpRegion *region, BYTE *buffer, UINT size,
DWORD
num_children
;
}
*
region_header
;
INT
filled
=
0
;
UINT
required
;
GpStatus
status
;
TRACE
(
"%p, %p, %d, %p
\n
"
,
region
,
buffer
,
size
,
needed
);
if
(
!
(
region
&&
buffer
&&
size
)
)
if
(
!
region
||
!
buffer
||
!
size
)
return
InvalidParameter
;
status
=
GdipGetRegionDataSize
(
region
,
&
required
);
if
(
status
!=
Ok
)
return
status
;
if
(
size
<
required
)
{
if
(
needed
)
*
needed
=
size
;
return
InsufficientBuffer
;
}
region_header
=
(
struct
_region_header
*
)
buffer
;
region_header
->
size
=
sizeheader_size
+
get_element_size
(
&
region
->
node
);
region_header
->
checksum
=
0
;
...
...
dlls/gdiplus/tests/region.c
View file @
761391f1
...
...
@@ -133,11 +133,8 @@ static void test_getregiondata(void)
memset
(
buf
,
0xee
,
sizeof
(
buf
));
needed
=
0
;
status
=
GdipGetRegionData
(
region
,
(
BYTE
*
)
buf
,
4
,
&
needed
);
todo_wine
ok
(
status
==
InsufficientBuffer
,
"status %08x
\n
"
,
status
);
todo_wine
expect
(
4
,
needed
);
todo_wine
expect_dword
(
buf
,
0xeeeeeeee
);
memset
(
buf
,
0xee
,
sizeof
(
buf
));
...
...
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