mirror of
https://github.com/json-c/json-c.git
synced 2026-03-23 23:19:06 +08:00
Merge pull request #325 from rouault/fix_stack_overflow_in_json_object_double_to_json_string_format
Fix stack buffer overflow in json_object_double_to_json_string_format()
This commit is contained in:
@@ -717,6 +717,8 @@ static int json_object_double_to_json_string_format(struct json_object* jso,
|
||||
format ? format :
|
||||
(modf(jso->o.c_double, &dummy) == 0) ? "%.17g.0" : "%.17g",
|
||||
jso->o.c_double);
|
||||
if(size < 0 || size >= (int)sizeof(buf))
|
||||
size = (int)sizeof(buf);
|
||||
|
||||
p = strchr(buf, ',');
|
||||
if (p) {
|
||||
|
||||
Reference in New Issue
Block a user