diff --git a/lib/secure-streams/policy-json.c b/lib/secure-streams/policy-json.c index 94f6ee61b..d496485e1 100644 --- a/lib/secure-streams/policy-json.c +++ b/lib/secure-streams/policy-json.c @@ -1225,10 +1225,11 @@ lws_ss_policy_parse(struct lws_context *context, const uint8_t *buf, size_t len) int m; #if !defined(LWS_PLAT_FREERTOS) && !defined(LWS_PLAT_OPTEE) - if (args->jctx.line < 2 && buf[0] != '{') + if (args->jctx.line < 2 && buf[0] != '{' && !args->parse_data) return lws_ss_policy_parse_file(context, (const char *)buf); #endif + args->parse_data = 1; m = lejp_parse(&args->jctx, buf, (int)len); if (m == LEJP_CONTINUE || m >= 0) return m; diff --git a/lib/secure-streams/private-lib-secure-streams.h b/lib/secure-streams/private-lib-secure-streams.h index 59ff57023..e237168a3 100644 --- a/lib/secure-streams/private-lib-secure-streams.h +++ b/lib/secure-streams/private-lib-secure-streams.h @@ -471,6 +471,8 @@ struct policy_cb_args { int count; char pending_respmap; + + uint8_t parse_data:1; }; #if defined(LWS_WITH_SYS_SMD)