Bug description
SimpleChannel.parseSocketAddress returns null for empty addresses or strings that do not split into host:port, but it directly calls Integer.parseInt(segments[1]) when the input has two segments.
For malformed values such as 127.0.0.1:not-a-port, calling remoteAddress() or localAddress() on SimpleChannel throws NumberFormatException instead of treating the address as invalid.
SimpleChannel is used by the proxy to adapt request contexts into lightweight Netty channels for local/remoting processing. A malformed address string should not make address access throw unexpectedly.
Expected behavior
SimpleChannel should tolerate malformed port values and return null for invalid socket address strings, consistent with how it already handles blank and non-host:port values.
Affected area
proxy module, internal SimpleChannel address parsing.
Suggested fix
- Catch invalid port parsing in
parseSocketAddress.
- Return
null for malformed port values.
- Add unit tests for valid addresses, blank/missing-port values, and non-numeric port values.
Bug description
SimpleChannel.parseSocketAddressreturnsnullfor empty addresses or strings that do not split intohost:port, but it directly callsInteger.parseInt(segments[1])when the input has two segments.For malformed values such as
127.0.0.1:not-a-port, callingremoteAddress()orlocalAddress()onSimpleChannelthrowsNumberFormatExceptioninstead of treating the address as invalid.SimpleChannelis used by the proxy to adapt request contexts into lightweight Netty channels for local/remoting processing. A malformed address string should not make address access throw unexpectedly.Expected behavior
SimpleChannelshould tolerate malformed port values and returnnullfor invalid socket address strings, consistent with how it already handles blank and non-host:portvalues.Affected area
proxymodule, internalSimpleChanneladdress parsing.Suggested fix
parseSocketAddress.nullfor malformed port values.