Skip to content

Commit

Permalink
Added error case for yajl_parse_integer "integer" to check the
Browse files Browse the repository at this point in the history
characters are between 0-9, and setting an error case otherwise.

Signed-off-by: Lloyd Hilaiel <lloyd@hilaiel.com>
  • Loading branch information
Joey Ekstrom authored and lloyd committed Dec 19, 2011
1 parent b0ea416 commit 52d60b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/yajl_parser.c
Expand Up @@ -51,6 +51,10 @@ yajl_parse_integer(const unsigned char *number, unsigned int length)
errno = ERANGE;
return sign == 1 ? LLONG_MAX : LLONG_MIN;
}
if (*pos < '0' || *pos > '9') {
errno = ERANGE;
return sign == 1 ? LLONG_MAX : LLONG_MIN;
}
ret += (*pos++ - '0');
}

Expand Down

0 comments on commit 52d60b8

Please sign in to comment.