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(
107107  if  (ReadFileSync (&package_config.raw_json , path.data ()) < 0 ) {
108108    return  nullptr ;
109109  }
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- 
123110  simdjson::ondemand::document document;
124111  simdjson::ondemand::object main_object;
125112  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);
127115
128116  const  auto  throw_invalid_package_config = [error_context, path, realm]() {
129117    if  (error_context == nullptr ) {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments