AnantShukla-Git-Hub commented on issue #3192:
URL: https://github.com/apache/brpc/issues/3192#issuecomment-3728429664
Hi,
This PR fixes a bug in `butil/endpoint.cpp` within
`str2endpoint(const char* str, EndPoint* point)`.
Previously, the validation loop at line 291 incremented `end` before checking
for whitespace:
for (++end; isspace(*end); ++end);
This caused the first non-digit character after the port to be skipped,
allowing invalid inputs such as `0.0.0.0:8000a` to be accepted.
The fix removes the premature increment so that only whitespace is skipped:
for (; isspace(*end); ++end);
With this change, endpoint strings containing trailing non-whitespace
characters after the port are correctly rejected.
--
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]