From ee32bdf4d021b525e9eaf975917fd3d402188695 Mon Sep 17 00:00:00 2001 From: nekobit Date: Wed, 27 Jul 2022 03:52:55 +0000 Subject: [PATCH] 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 --- src/json_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/json_helper.c b/src/json_helper.c index e9c7e4f..e5352c5 100644 --- a/src/json_helper.c +++ b/src/json_helper.c @@ -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;