mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
json: fix oom when adding a long string
This commit is contained in:
parent
d753ee27a2
commit
8af5764a9c
@ -194,8 +194,9 @@ void json_add_jsonstr(struct json_stream *js,
|
|||||||
size_t len = strlen(jsonstr);
|
size_t len = strlen(jsonstr);
|
||||||
|
|
||||||
p = json_member_direct(js, fieldname, len);
|
p = json_member_direct(js, fieldname, len);
|
||||||
|
/* Could be OOM! */
|
||||||
memcpy(p, jsonstr, len);
|
if (p)
|
||||||
|
memcpy(p, jsonstr, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is where we read the json_stream and write it to conn */
|
/* This is where we read the json_stream and write it to conn */
|
||||||
|
Loading…
Reference in New Issue
Block a user