json: Add overflow checks for integer and float parsing

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
This commit is contained in:
Arun Raghavan 2016-06-01 17:18:34 +05:30
parent 708b4aac91
commit 777a5091f6
2 changed files with 21 additions and 0 deletions

View file

@ -220,6 +220,9 @@ START_TEST(bad_test) {
unsigned int i;
const char *bad_parse[] = {
"\"" /* Quote not closed */,
"123456789012345678901234567890" /* Overflow */,
"0.123456789012345678901234567890" /* Overflow */,
"1e123456789012345678901234567890" /* Overflow */,
};
for (i = 0; i < PA_ELEMENTSOF(bad_parse); i++) {