Merge pull request #12064 from akallabeth/jansson-null

[winpr,utils] explicit NULL checks in jansson WINPR_JSON_ParseWithLength
This commit is contained in:
akallabeth
2025-12-11 09:25:42 +01:00
committed by GitHub

View File

@@ -114,6 +114,9 @@ WINPR_JSON* WINPR_JSON_Parse(const char* value)
WINPR_JSON* WINPR_JSON_ParseWithLength(const char* value, size_t buffer_length)
{
if (!value || (buffer_length == 0))
return NULL;
json_error_t error = { 0 };
const size_t slen = strnlen(value, buffer_length);
WINPR_JSON* json = revcast(json_loadb(value, slen, JSON_DECODE_ANY, &error));