-Fixed 32 bit integer number parsing bug

This commit is contained in:
James Newton-King
2015-09-11 17:48:41 +12:00
parent 38fe3c38f6
commit ddfd52f79c
2 changed files with 28 additions and 16 deletions
@@ -666,7 +666,9 @@ namespace Newtonsoft.Json.Utilities
int end = start + length;
// Int32.MaxValue and MinValue are 10 chars
if (length > 10)
// Or is 10 chars and start is greater than two
// Need to improve this!
if (length > 10 || (length == 10 && chars[start] - '0' > 2))
{
// invalid result takes precedence over overflow
for (int i = start; i < end; i++)