File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -102,23 +102,11 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON(
102102 if (ReadFileSync (&package_config.raw_json , path.data ()) < 0 ) {
103103 return nullptr ;
104104 }
105- // In some systems, std::string is annotated to generate an
106- // AddressSanitizer: container-overflow error when reading beyond the end of
107- // the string even when we are still within the capacity of the string.
108- // https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow
109- // https://github.com/nodejs/node/issues/55584
110- // The next lines are a workaround to avoid this false positive.
111- size_t json_length = package_config.raw_json .size ();
112- package_config.raw_json .append (simdjson::SIMDJSON_PADDING, ' ' );
113- simdjson::padded_string_view json_view (package_config.raw_json .data (),
114- json_length,
115- package_config.raw_json .size ());
116- // End of workaround
117-
118105 simdjson::ondemand::document document;
119106 simdjson::ondemand::object main_object;
120107 simdjson::error_code error =
121- binding_data->json_parser .iterate(json_view).get (document);
108+ binding_data->json_parser .iterate(simdjson::pad (package_config.raw_json ))
109+ .get (document);
122110
123111 const auto throw_invalid_package_config = [error_context, path, realm]() {
124112 if (error_context == nullptr ) {
You can’t perform that action at this time.
0 commit comments