MCPcopy Create free account
hub / github.com/ElementsProject/lightning / validate_jsmn_parse_output

Function validate_jsmn_parse_output

common/json_parse_simple.c:464–474  ·  view source on GitHub ↗

validate_jsmn_parse_output * * @brief Validates the result of jsmn_parse. * * @desc LIBJMSN is a small fast library, not a * comprehensive library. * * This simply means that LIBJSMN will accept a * *lot* of very strange text that is technically * not JSON. * * For example, LIBJSMN would accept the strings * `{"1" "2" "3" "4"}` and `["key": 1 2 3 4]` as valid. * * This can lead to st

Source from the content-addressed store, hash-verified

462 * `jsmn_parse`, false otherwise.
463 */
464static bool
465validate_jsmn_parse_output(const char *buf,
466 const jsmntok_t *p, const jsmntok_t *end)
467{
468 bool valid = true;
469
470 while (p < end && valid)
471 p = validate_jsmn_datum(buf, p, end, &valid);
472
473 return valid;
474}
475
476/*-----------------------------------------------------------------------------
477JSMN Result Validation Ends

Callers 1

json_parse_inputFunction · 0.85

Calls 1

validate_jsmn_datumFunction · 0.85

Tested by

no test coverage detected