提交 56f2bc6f 编写于 作者: M Max Bruckner

handle null pointers: cJSON_PrintPreallocated

上级 cdc35ebf
......@@ -1122,7 +1122,7 @@ CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buf, const i
{
printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };
if (len < 0)
if ((len < 0) || (buf == NULL))
{
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册