sofastack / sofa-bolt

SOFABolt is a lightweight, easy to use and high performance remoting framework based on Netty.
https://www.sofastack.tech/projects/sofa-bolt/
Apache License 2.0
2.41k stars 860 forks source link

PortScan ServerSocket ss may be null #187

Closed QiAnXinCodeSafe closed 4 years ago

QiAnXinCodeSafe commented 4 years ago

Your question

ss 可能是null,未做判断处理,会引起空指针异常 https://github.com/sofastack/sofa-bolt/blob/3e2e8090ceabb06f3c2799ead3a1614589fe272c/src/test/java/com/alipay/remoting/rpc/common/PortScan.java#L41 当 new ServerSocket()抛出异常时 https://github.com/sofastack/sofa-bolt/blob/3e2e8090ceabb06f3c2799ead3a1614589fe272c/src/test/java/com/alipay/remoting/rpc/common/PortScan.java#L34

Your scenes

describe your use scenes (why need this feature)

Your advice

describe the advice or solution you'd like

Environment

sofastack-bot[bot] commented 4 years ago

Hi @QiAnXinCodeSafe, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.

We encourage you to describe your issue in English which is more friendly to other users.

Your question ss may be null, not judged, will cause a null pointer exception https://github.com/sofastack/sofa-bolt/blob/3e2e8090ceabb06f3c2799ead3a1614589fe272c/src/test/java/com/alipay/remoting/ Rpc/common/PortScan.java#L41 When new ServerSocket() throws an exception https://github.com/sofastack/sofa-bolt/blob/3e2e8090ceabb06f3c2799ead3a1614589fe272c/src/test/java/com/alipay/remoting/rpc/ Common/PortScan.java#L34 ### Your scenes describe your use scenes (why need this feature) ### Your advice describe the advice or solution you'd like ### Environment - SOFABolt version: - JVM version (eg Java -version): - OS version (eg uname -a): - Maven version: - IDE version:

cytnju commented 4 years ago

欢迎提PR解决

QiAnXinCodeSafe commented 4 years ago

好的,后续提交