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
65642f4b
Commit
65642f4b
authored
May 01, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
May 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Avoid depending on signed variable overflow in parse_double.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9733b821
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
string.c
dlls/msvcrt/string.c
+6
-2
No files found.
dlls/msvcrt/string.c
View file @
65642f4b
...
...
@@ -549,8 +549,10 @@ static double strtod16(MSVCRT_wchar_t get(void *ctx), void unget(void *ctx),
}
if
(
nch
>=
'0'
&&
nch
<=
'9'
)
{
while
(
nch
>=
'0'
&&
nch
<=
'9'
)
{
if
(
e
>
INT_MAX
/
10
||
(
e
=
e
*
10
+
nch
-
'0'
)
<
0
)
if
(
e
>
INT_MAX
/
10
||
e
*
10
>
INT_MAX
-
nch
+
'0'
)
e
=
INT_MAX
;
else
e
=
e
*
10
+
nch
-
'0'
;
nch
=
get
(
ctx
);
}
if
((
nch
!=
MSVCRT_WEOF
)
&&
(
nch
<
'0'
||
nch
>
'9'
))
unget
(
ctx
);
...
...
@@ -827,8 +829,10 @@ double parse_double(MSVCRT_wchar_t (*get)(void *ctx), void (*unget)(void *ctx),
if
(
nch
>=
'0'
&&
nch
<=
'9'
)
{
while
(
nch
>=
'0'
&&
nch
<=
'9'
)
{
if
(
e
>
INT_MAX
/
10
||
(
e
=
e
*
10
+
nch
-
'0'
)
<
0
)
if
(
e
>
INT_MAX
/
10
||
e
*
10
>
INT_MAX
-
nch
+
'0'
)
e
=
INT_MAX
;
else
e
=
e
*
10
+
nch
-
'0'
;
nch
=
get
(
ctx
);
}
if
(
nch
!=
MSVCRT_WEOF
)
unget
(
ctx
);
...
...
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