| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -102,23 +102,11 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON( | |||
| 102 | 102 | if (ReadFileSync(&package_config.raw_json, path.data()) < 0) { | |
| 103 | 103 | return nullptr; | |
| 104 | 104 | } | |
| 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 | - | ||
| 118 | 105 | simdjson::ondemand::document document; | |
| 119 | 106 | simdjson::ondemand::object main_object; | |
| 120 | 107 | 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); | ||
| 122 | 110 | ||
| 123 | 111 | const auto throw_invalid_package_config = [error_context, path, realm]() { | |
| 124 | 112 | if (error_context == nullptr) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments