diff options
author | Milo Yip <miloyip@gmail.com> | 2014-07-30 19:27:17 +0400 |
---|---|---|
committer | Milo Yip <miloyip@gmail.com> | 2014-07-30 19:27:17 +0400 |
commit | 808d362b884847567233e95afb33315d9ec81a72 (patch) | |
tree | e8ac0fb91208d647dcdcc8d6ad2ae06522d4a6af /include | |
parent | c4f64e7b02f1af5d309fce6b62a9333c6d64b0cf (diff) |
Fix parsing numbers which are less than 1e-308
Overflow should check sign of exponent.
Diffstat (limited to 'include')
-rw-r--r-- | include/rapidjson/reader.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index 5d3493a9..9fd46b15 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -796,7 +796,7 @@ private: exp = s.Take() - '0';
while (s.Peek() >= '0' && s.Peek() <= '9') {
exp = exp * 10 + (s.Take() - '0');
- if (exp > 308)
+ if (exp > 308 && !expMinus) // exp > 308 should be rare, so it should be checked first.
RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, s.Tell());
}
}
|