ethereum / ethereumj

DEPRECATED! Java implementation of the Ethereum yellowpaper. For JSON-RPC and other client features check Ethereum Harmony
GNU Lesser General Public License v3.0
2.18k stars 1.1k forks source link

Fix discovery exception handling #1160

Closed mkalinin closed 6 years ago

mkalinin commented 6 years ago

Fixes UDPListener crash caused by malformed nodeId received from malicious peers.

zilm13 commented 6 years ago

I think you should disconnect it in case of error anyway, should you?

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.007%) to 56.116% when pulling 8ee599b7b6b49a34aa77b9fdac8ceb6ac4c1af08 on fix/discovery-exceptions into ec3ce8fccb75987f101096c61af137c4f5b17adb on develop.

mkalinin commented 6 years ago

@zilm13

I think you should disconnect it in case of error anyway, should you?

UDP is connectionless protocol, thus there is no session that can be closed.

mkalinin commented 6 years ago

Thanks a lot to @JMdoubleU for pointing to that problem!

zilm13 commented 6 years ago

@mkalinin

UDP is connectionless protocol, thus there is no session that can be closed.

oops, forgot that discovery works on UDP