mirror of
https://github.com/json-c/json-c.git
synced 2026-09-08 17:16:49 +08:00
reject negative after whitespace in json_parse_uint64
This commit is contained in:
@@ -145,6 +145,11 @@ int main(int argc, char **argv)
|
||||
strcpy(buf, "-9223372036854775808");
|
||||
checkit_uint(buf);
|
||||
|
||||
// A negative value hidden behind non-space whitespace must still be
|
||||
// rejected; strtoull() skips this whitespace and would wrap the '-'.
|
||||
strcpy(buf, "\t-1");
|
||||
checkit_uint(buf);
|
||||
|
||||
strcpy(buf, " 1");
|
||||
checkit_uint(buf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user