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 @@ -107,23 +107,11 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON(
107
107
if (ReadFileSync (&package_config.raw_json , path.data ()) < 0 ) {
108
108
return nullptr ;
109
109
}
110
- // In some systems, std::string is annotated to generate an
111
- // AddressSanitizer: container-overflow error when reading beyond the end of
112
- // the string even when we are still within the capacity of the string.
113
- // https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow
114
- // https://github.com/nodejs/node/issues/55584
115
- // The next lines are a workaround to avoid this false positive.
116
- size_t json_length = package_config.raw_json .size ();
117
- package_config.raw_json .append (simdjson::SIMDJSON_PADDING, ' ' );
118
- simdjson::padded_string_view json_view (package_config.raw_json .data (),
119
- json_length,
120
- package_config.raw_json .size ());
121
- // End of workaround
122
-
123
110
simdjson::ondemand::document document;
124
111
simdjson::ondemand::object main_object;
125
112
simdjson::error_code error =
126
- binding_data->json_parser .iterate(json_view).get (document);
113
+ binding_data->json_parser .iterate(simdjson::pad (package_config.raw_json ))
114
+ .get (document);
127
115
128
116
const auto throw_invalid_package_config = [error_context, path, realm]() {
129
117
if (error_context == nullptr ) {
You can’t perform that action at this time.
0 commit comments