mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +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);
|
||||
|
||||
p = json_member_direct(js, fieldname, len);
|
||||
|
||||
memcpy(p, jsonstr, len);
|
||||
/* Could be OOM! */
|
||||
if (p)
|
||||
memcpy(p, jsonstr, len);
|
||||
}
|
||||
|
||||
/* This is where we read the json_stream and write it to conn */
|
||||
|
Loading…
Reference in New Issue
Block a user