Extra step for thread safety

Nothing breaks, but it still overreads the error data for cJSON unless we use ParseWithLengthOpts (I set the error value to NULL for now, this might bite me in the ass later)

FossilOrigin-Name: 6451d34540d66e921d5f94a7da49c688dee82ed0aaf5b63b1a101dd91f71e6b1
This commit is contained in:
nekobit 2022-07-27 03:52:55 +00:00
parent bb494dd06b
commit ee32bdf4d0

View file

@ -27,7 +27,7 @@ int _mstdnt_json_init(cJSON** root,
struct mstdnt_fetch_results* results,
struct mstdnt_storage* storage)
{
*root = cJSON_ParseWithLength(results->response, results->size);
*root = cJSON_ParseWithLengthOpts(results->response, results->size, NULL, 0);
storage->root = *root;
if (*root == NULL)
return 1;