Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added error case for yajl_parse_integer "integer" to check the

characters are between 0-9, and setting an error case otherwise.

Signed-off-by: Lloyd Hilaiel <lloyd@hilaiel.com>
  • Loading branch information...
commit 52d60b8f6a42e8b04ab2fa323ef338a9231d1b97 1 parent b0ea416
@jcekstrom jcekstrom authored committed
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/yajl_parser.c
View
4 src/yajl_parser.c
@@ -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');
}
Please sign in to comment.
Something went wrong with that request. Please try again.