Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
7708215b
Commit
7708215b
authored
Apr 24, 2015
by
Milo Yip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to fix #313 again
parent
735354ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
reader.h
include/rapidjson/reader.h
+1
-1
readertest.cpp
test/unittest/readertest.cpp
+3
-2
No files found.
include/rapidjson/reader.h
View file @
7708215b
...
...
@@ -928,7 +928,7 @@ private:
if
(
expMinus
)
{
while
(
s
.
Peek
()
>=
'0'
&&
s
.
Peek
()
<=
'9'
)
{
exp
=
exp
*
10
+
(
s
.
Take
()
-
'0'
);
if
(
exp
>=
429496729
)
{
// Issue #313: prevent overflow exponent
if
(
exp
>=
214748364
)
{
// Issue #313: prevent overflow exponent
while
(
s
.
Peek
()
>=
'0'
&&
s
.
Peek
()
<=
'9'
)
// Consume the rest of exponent
s
.
Take
();
}
...
...
test/unittest/readertest.cpp
View file @
7708215b
...
...
@@ -228,9 +228,10 @@ static void TestParseDouble() {
TEST_DOUBLE
(
fullPrecision
,
"2.2250738585072011e-308"
,
2.2250738585072011e-308
);
// http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/
TEST_DOUBLE
(
fullPrecision
,
"1e-00011111111111"
,
0.0
);
// Issue #313
TEST_DOUBLE
(
fullPrecision
,
"-1e-00011111111111"
,
-
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"1e-429496729"
,
0.0
);
// Maximum supported negative exponent
TEST_DOUBLE
(
fullPrecision
,
"1e-214748363"
,
0.0
);
// Maximum supported negative exponent
TEST_DOUBLE
(
fullPrecision
,
"1e-214748364"
,
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"1e-21474836311"
,
0.0
);
TEST_DOUBLE
(
fullPrecision
,
"0.017976931348623157e+310"
,
1.7976931348623157e+308
);
// Max double in another form
// Since
// abs((2^-1022 - 2^-1074) - 2.2250738585072012e-308) = 3.109754131239141401123495768877590405345064751974375599... 10^-324
...
...
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