cjson 内存溢出错误
cJSON
Ultralightweight JSON parser in ANSI C
项目地址:https://gitcode.com/gh_mirrors/cj/cJSON

·
情况描述:
使用cjson构建json发送,报内存溢出错误
解决方案:
使用cjson打包发送
//构建的cjson根节点,挂载了许多的其他节点
cJSON *list_root = cJSON_CreateArray();
//打包
char *c_json = cJSON_PrintUnformatted(list_root);
//在释放内存前可传递到其他的地方
//释放内存
cJSON_free(c_json);
cJSON_Delete(list_root);




Ultralightweight JSON parser in ANSI C
最近提交(Master分支:29 天前 )
c859b25d
28 天前
74e1ff49
this fixes CVE-2025-57052 1 个月前
更多推荐
所有评论(0)