From b1f578cb0d5a0c43748a42396af9c39e242c0157 Mon Sep 17 00:00:00 2001 From: Levi Broderick Date: Thu, 27 Mar 2025 19:07:21 -0700 Subject: [PATCH] Rename rapidjson helper functions --- src/native/corehost/comhost/clsidmap.cpp | 4 ++-- src/native/corehost/fxr/sdk_resolver.cpp | 2 +- .../fxr/standalone/hostpolicy_resolver.cpp | 2 +- src/native/corehost/hostpolicy/deps_format.cpp | 4 ++-- src/native/corehost/json_parser.cpp | 14 ++++++++++---- src/native/corehost/json_parser.h | 4 ++-- src/native/corehost/runtime_config.cpp | 4 ++-- 7 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/native/corehost/comhost/clsidmap.cpp b/src/native/corehost/comhost/clsidmap.cpp index 001649765f662e..281dc1cef3d4ef 100644 --- a/src/native/corehost/comhost/clsidmap.cpp +++ b/src/native/corehost/comhost/clsidmap.cpp @@ -100,7 +100,7 @@ namespace throw HResultException{ E_UNEXPECTED }; // This should never happen in Windows 7+ json_parser_t json; - if (!json.parse_raw_data(reinterpret_cast(data), size, _X(""))) + if (!json.parse_fully_trusted_raw_data(reinterpret_cast(data), size, _X(""))) { trace::error(_X("Embedded .clsidmap format is invalid")); throw HResultException{ StatusCode::InvalidConfigFile }; @@ -178,7 +178,7 @@ namespace return {}; json_parser_t json; - if (!json.parse_file(map_file_name)) + if (!json.parse_fully_trusted_file(map_file_name)) { trace::error(_X("File .clsidmap format is invalid")); throw HResultException{ StatusCode::InvalidConfigFile }; diff --git a/src/native/corehost/fxr/sdk_resolver.cpp b/src/native/corehost/fxr/sdk_resolver.cpp index dd54f2e7932459..7a365001b1c796 100644 --- a/src/native/corehost/fxr/sdk_resolver.cpp +++ b/src/native/corehost/fxr/sdk_resolver.cpp @@ -325,7 +325,7 @@ bool sdk_resolver::parse_global_file(pal::string_t global_file_path) // After we're done parsing `global_file_path`, none of its contents will be referenced // from the data private to json_parser_t; it's safe to declare it on the stack. json_parser_t json; - if (!json.parse_file(global_file_path)) + if (!json.parse_fully_trusted_file(global_file_path)) { return false; } diff --git a/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp b/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp index 4e75400a04a81b..8a047a145ef9f8 100644 --- a/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp +++ b/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp @@ -29,7 +29,7 @@ namespace pal::string_t retval; json_parser_t json; - if (!json.parse_file(deps_json)) + if (!json.parse_fully_trusted_file(deps_json)) { return retval; } diff --git a/src/native/corehost/hostpolicy/deps_format.cpp b/src/native/corehost/hostpolicy/deps_format.cpp index 7a58f12bb067f2..a882199819a757 100644 --- a/src/native/corehost/hostpolicy/deps_format.cpp +++ b/src/native/corehost/hostpolicy/deps_format.cpp @@ -94,7 +94,7 @@ deps_json_t::rid_fallback_graph_t deps_json_t::get_rid_fallback_graph(const pal: return rid_fallback_graph; json_parser_t json; - if (!json.parse_file(deps_path_local)) + if (!json.parse_fully_trusted_file(deps_path_local)) return rid_fallback_graph; populate_rid_fallback_graph(json.document(), rid_fallback_graph); @@ -586,7 +586,7 @@ void deps_json_t::load(bool is_framework_dependent, std::function