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
72807622
Commit
72807622
authored
Aug 19, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Aug 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix possible integer overflow in VarR4FromDec.
parent
33aa59ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
vartype.c
dlls/oleaut32/tests/vartype.c
+2
-1
vartype.c
dlls/oleaut32/vartype.c
+4
-4
No files found.
dlls/oleaut32/tests/vartype.c
View file @
72807622
...
...
@@ -2890,7 +2890,8 @@ static void test_VarR4FromDec(void)
CONVERT_DEC
(
VarR4FromDec
,
2
,
0x80
,
0
,
3276800
);
EXPECT
(
-
32768
.
0
f
);
CONVERT_DEC
(
VarR4FromDec
,
2
,
0
,
0
,
3276700
);
EXPECT
(
32767
.
0
f
);
CONVERT_DEC
(
VarR4FromDec
,
10
,
0
,
0
,
3276700
);
EXPECT
(
0
.
00032767
f
);
CONVERT_DEC
(
VarR4FromDec
,
0
,
0
,
1
,
0
);
EXPECT
(
18446744073709551616
.
0
f
);
}
...
...
dlls/oleaut32/vartype.c
View file @
72807622
...
...
@@ -2948,28 +2948,28 @@ HRESULT WINAPI VarR4FromUI4(ULONG ulIn, float *pFltOut)
HRESULT
WINAPI
VarR4FromDec
(
DECIMAL
*
pDecIn
,
float
*
pFltOut
)
{
BYTE
scale
=
DEC_SCALE
(
pDecIn
);
int
divisor
=
1
;
double
divisor
=
1
.
0
;
double
highPart
;
if
(
scale
>
DEC_MAX_SCALE
||
DEC_SIGN
(
pDecIn
)
&
~
DECIMAL_NEG
)
return
E_INVALIDARG
;
while
(
scale
--
)
divisor
*=
10
;
divisor
*=
10
.
0
;
if
(
DEC_SIGN
(
pDecIn
))
divisor
=
-
divisor
;
if
(
DEC_HI32
(
pDecIn
))
{
highPart
=
(
double
)
DEC_HI32
(
pDecIn
)
/
(
double
)
divisor
;
highPart
=
(
double
)
DEC_HI32
(
pDecIn
)
/
divisor
;
highPart
*=
4294967296
.
0
F
;
highPart
*=
4294967296
.
0
F
;
}
else
highPart
=
0
.
0
;
*
pFltOut
=
(
double
)
DEC_LO64
(
pDecIn
)
/
(
double
)
divisor
+
highPart
;
*
pFltOut
=
(
double
)
DEC_LO64
(
pDecIn
)
/
divisor
+
highPart
;
return
S_OK
;
}
...
...
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