ShadowySpirits commented on code in PR #5029:
URL: https://github.com/apache/rocketmq/pull/5029#discussion_r966652239
##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyDecoder.java:
##########
@@ -45,6 +46,14 @@ public Object decode(ChannelHandlerContext ctx, ByteBuf in)
throws Exception {
}
return RemotingCommand.decode(frame);
} catch (Exception e) {
+ in.resetReaderIndex();
Review Comment:
Under normal circumstances, there will not be many malformed frames. So this
feature has almost no impact on performance. If there are a lot of malformed
frames, it may be a packet flood attack. We should ban attacker ip.
@zhouxinyu do you have any better suggestions?
--
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]