songgaoye opened a new pull request, #3608:
URL: https://github.com/apache/brpc/pull/3608

   ### What problem does this PR solve?
   
   Issue Number: resolve
   
   Problem Summary:
   
   `RemoteFileNamingService::GetServers()` skips leading slashes after `://`
   without checking the bounds of the service-name string. Malformed service
   names such as `http://`, `bns://`, and `http:////` can read past the end of
   the string before validation.
   
   ### What is changed and the side effects?
   
   Changed:
   
   Check the string boundary while skipping slashes and reject service names
   without a server address.
   
   Add regression coverage for malformed URL-like service names.
   
   Side effects:
   
   * Performance effects:
   
   * Breaking backward compatibility:
   
   * * *
   
   ### Check List:
   
   * Please make sure your changes are compilable.
   * When providing us with a new feature, it is best to add related tests.
   * Please follow [Contributor Covenant Code of 
Conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct/).
   
   ### Testing
   
   ```sh
   cmake --build build --target brpc_naming_service_unittest -j2
   ./build/test/brpc_naming_service_unittest \
     --gtest_filter=NamingServiceTest.remotefile_invalid_url
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to