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
3e5159e1
Commit
3e5159e1
authored
Jul 07, 2009
by
Hib Eris
Committed by
Alexandre Julliard
Jul 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Prevent overflow in VarDecCmp.
parent
eb8778f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
vartype.c
dlls/oleaut32/tests/vartype.c
+12
-12
vartype.c
dlls/oleaut32/vartype.c
+10
-0
No files found.
dlls/oleaut32/tests/vartype.c
View file @
3e5159e1
...
@@ -4420,11 +4420,11 @@ static void test_VarDecCmp(void)
...
@@ -4420,11 +4420,11 @@ static void test_VarDecCmp(void)
SETDEC
(
l
,
0
,
0
,
0
,
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
0
,
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
0
,
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
0
,
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
0
,
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
0
,
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
out
,
0
,
0
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
out
,
0
,
0
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
out
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
out
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_EQ
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_EQ
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
...
@@ -4450,13 +4450,13 @@ static void test_VarDecCmp(void)
...
@@ -4450,13 +4450,13 @@ static void test_VarDecCmp(void)
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_EQ
;
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_EQ
;
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_GT
;
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
0
,
0
,
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
0
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
...
@@ -4469,11 +4469,11 @@ static void test_VarDecCmp(void)
...
@@ -4469,11 +4469,11 @@ static void test_VarDecCmp(void)
SETDEC
(
out
,
0
,
0
,
0
,
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
0
,
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
0
,
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
0
,
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
0
,
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
0
,
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
l
,
0
,
0
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
l
,
0
,
0
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
l
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
l
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_EQ
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_EQ
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
0
,
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
...
@@ -4499,13 +4499,13 @@ static void test_VarDecCmp(void)
...
@@ -4499,13 +4499,13 @@ static void test_VarDecCmp(void)
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_EQ
;
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_EQ
;
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_LT
;
SETDEC
(
out
,
0
,
0
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_LT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
0
,
0
,
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
0
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
0
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
todo_wine
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
0
,
-
1
,
-
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
1
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
SETDEC
(
out
,
0
,
DECIMAL_NEG
,
-
1
,
-
1
);
SETDEC
(
l
,
0
,
DECIMAL_NEG
,
0
,
0
);
MATH1
(
VarDecCmp
);
EXPECT_GT
;
...
...
dlls/oleaut32/vartype.c
View file @
3e5159e1
...
@@ -5788,6 +5788,16 @@ HRESULT WINAPI VarDecCmp(const DECIMAL* pDecLeft, const DECIMAL* pDecRight)
...
@@ -5788,6 +5788,16 @@ HRESULT WINAPI VarDecCmp(const DECIMAL* pDecLeft, const DECIMAL* pDecRight)
HRESULT
hRet
;
HRESULT
hRet
;
DECIMAL
result
;
DECIMAL
result
;
if
(
!
pDecLeft
||
!
pDecRight
)
return
VARCMP_NULL
;
if
((
!
(
DEC_SIGN
(
pDecLeft
)
&
DECIMAL_NEG
))
&&
(
DEC_SIGN
(
pDecRight
)
&
DECIMAL_NEG
)
&&
(
DEC_HI32
(
pDecLeft
)
|
DEC_MID32
(
pDecLeft
)
|
DEC_LO32
(
pDecLeft
)))
return
VARCMP_GT
;
else
if
((
DEC_SIGN
(
pDecLeft
)
&
DECIMAL_NEG
)
&&
(
!
(
DEC_SIGN
(
pDecRight
)
&
DECIMAL_NEG
))
&&
(
DEC_HI32
(
pDecLeft
)
|
DEC_MID32
(
pDecLeft
)
|
DEC_LO32
(
pDecLeft
)))
return
VARCMP_LT
;
/* Subtract right from left, and compare the result to 0 */
/* Subtract right from left, and compare the result to 0 */
hRet
=
VarDecSub
(
pDecLeft
,
pDecRight
,
&
result
);
hRet
=
VarDecSub
(
pDecLeft
,
pDecRight
,
&
result
);
...
...
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