diff --git a/lib/secure-streams/policy-json.c b/lib/secure-streams/policy-json.c index 3427ae6d4..7e5656f67 100644 --- a/lib/secure-streams/policy-json.c +++ b/lib/secure-streams/policy-json.c @@ -1246,10 +1246,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 ebfa7efa0..70de42f0e 100644 --- a/lib/secure-streams/private-lib-secure-streams.h +++ b/lib/secure-streams/private-lib-secure-streams.h @@ -401,6 +401,8 @@ struct policy_cb_args { int count; char pending_respmap; + + uint8_t parse_data:1; }; #if defined(LWS_WITH_SYS_SMD)