Repository navigation
Validate remote file service names before parsing - #3608
Merged
chenBright merged 2 commits intoOct 16, 2026
Merged
Conversation
songgaoye
force-pushed
the
fix/remote-file-naming-url-bounds
branch
from
October 14, 2026 11:40
cfe8885 to
3281ea1
Compare
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open finding
What changed in this PR
Fixes an out-of-bounds read in RemoteFileNamingService::GetServers() when parsing malformed URL-like service names by adding bounds checks while skipping slashes and rejecting inputs without a server address.
Changes:
- Add bounds checking while skipping
://-prefixed slashes and reject empty server address cases. - Add a regression test covering malformed service names like
http://,bns://, andhttp:////.
| File | Description |
|---|---|
| test/brpc_naming_service_unittest.cpp | Adds a regression test ensuring malformed URL-like service names are rejected. |
| src/brpc/policy/remote_file_naming_service.cpp | Prevents out-of-bounds access and returns an error when no server address exists after ://. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot stopped reviewing on behalf of
chenBright due to an error
October 16, 2026 03:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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://, andhttp:////can read past the end ofthe 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:
Testing