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
4e94fd55
Commit
4e94fd55
authored
Nov 17, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix the overflow check in VarNumFromParseNum.
Spotted by Adam Martinson.
parent
5d7aac8c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
vartype.c
dlls/oleaut32/tests/vartype.c
+3
-1
variant.c
dlls/oleaut32/variant.c
+1
-1
No files found.
dlls/oleaut32/tests/vartype.c
View file @
4e94fd55
...
...
@@ -2592,7 +2592,9 @@ static void test_VarUI8FromStr(void)
CONVERT_STR
(
VarUI8FromStr
,
"0"
,
0
);
EXPECTI8
(
0
);
CONVERT_STR
(
VarUI8FromStr
,
"-1"
,
0
);
EXPECT_OVERFLOW
;
CONVERT_STR
(
VarUI8FromStr
,
"2147483647"
,
0
);
EXPECTI8
(
2147483647
);
CONVERT_STR
(
VarUI8FromStr
,
"18446744073709551615"
,
0
);
todo_wine
EXPECTI864
(
0xFFFFFFFF
,
0xFFFFFFFF
);
CONVERT_STR
(
VarUI8FromStr
,
"18446744073709551614"
,
0
);
EXPECTI864
(
0xFFFFFFFF
,
0xFFFFFFFE
);
CONVERT_STR
(
VarUI8FromStr
,
"18446744073709551615"
,
0
);
EXPECTI864
(
0xFFFFFFFF
,
0xFFFFFFFF
);
CONVERT_STR
(
VarUI8FromStr
,
"18446744073709551616"
,
0
);
EXPECT_OVERFLOW
;
CONVERT_STR
(
VarUI8FromStr
,
"-1.5"
,
LOCALE_NOUSEROVERRIDE
);
EXPECT_OVERFLOW
;
CONVERT_STR
(
VarUI8FromStr
,
"-0.6"
,
LOCALE_NOUSEROVERRIDE
);
EXPECT_OVERFLOW
;
...
...
dlls/oleaut32/variant.c
View file @
4e94fd55
...
...
@@ -2186,7 +2186,7 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
/* Convert the integer part of the number into a UI8 */
for
(
i
=
0
;
i
<
wholeNumberDigits
;
i
++
)
{
if
(
ul64
>
(
UI8_MAX
/
10
-
rgbDig
[
i
]
))
if
(
ul64
>
UI8_MAX
/
10
||
(
ul64
==
UI8_MAX
/
10
&&
rgbDig
[
i
]
>
UI8_MAX
%
10
))
{
TRACE
(
"Overflow multiplying digits
\n
"
);
bOverflow
=
TRUE
;
...
...
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