Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix possible NPE when trying to generate source ids for remote peer t… (
#631) …o use. Motivation: We need to ensure we check if we already have some source id before trying to use the source id to generate more ids for the remote peer to use otherwhise we might see a NPE: ``` 11:58:38.663 [nioEventLoopGroup-2-1] DEBUG io.netty.incubator.codec.quic.QuicheQuicCodec -- Error while processing QUIC packet java.lang.NullPointerException: Cannot read field "connId" because "this.localIdAdrr" is null at io.netty.incubator.codec.quic.QuicheQuicChannel.newSourceConnectionIds(QuicheQuicChannel.java:917) at io.netty.incubator.codec.quic.QuicheQuicServerCodec.channelRecv(QuicheQuicServerCodec.java:110) at io.netty.incubator.codec.quic.QuicheQuicCodec$QuicCodecHeaderProcessor.process(QuicheQuicCodec.java:293) at io.netty.incubator.codec.quic.QuicHeaderParser.parse(QuicHeaderParser.java:127) at io.netty.incubator.codec.quic.QuicheQuicCodec.handleQuicPacket(QuicheQuicCodec.java:164) at io.netty.incubator.codec.quic.QuicheQuicCodec.channelRead(QuicheQuicCodec.java:155) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:97) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:1583) ``` Modifications: Always retrieve the source id and check for null without caching it. This is also needed as the source id might change during the life-time of the connection Result: No more NPE
- Loading branch information