SslHandler: Fix possible NPE when executor is used for delegating (#1…#14833
Merged
normanmaurer merged 1 commit into4.2from Feb 18, 2025
Merged
SslHandler: Fix possible NPE when executor is used for delegating (#1…#14833normanmaurer merged 1 commit into4.2from
normanmaurer merged 1 commit into4.2from
Conversation
…4830) Motivation: We need to check if pendingUnencryptedWrites is null before accessing it as the SslHandler might have been removed in the meantime. ``` io.netty.handler.codec.DecoderException: java.lang.NullPointerException: Cannot invoke "io.netty.handler.ssl.SslHandlerCoalescingBufferQueue.isEmpty()" because "this.pendingUnencryptedWrites" is null at io.netty.handler.ssl.SslHandler$SslTasksRunner.wrapIfNeeded(SslHandler.java:1798) at io.netty.handler.ssl.SslHandler$SslTasksRunner.safeExceptionCaught(SslHandler.java:1785) at io.netty.handler.ssl.SslHandler$SslTasksRunner.resumeOnEventExecutor(SslHandler.java:1896) at io.netty.handler.ssl.SslHandler$SslTasksRunner.access$2000(SslHandler.java:1751) at io.netty.handler.ssl.SslHandler$SslTasksRunner$2.run(SslHandler.java:1912) at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:405) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.NullPointerException: Cannot invoke "io.netty.handler.ssl.SslHandlerCoalescingBufferQueue.isEmpty()" because "this.pendingUnencryptedWrites" is null at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1503) at io.netty.handler.ssl.SslHandler.unwrapNonAppData(SslHandler.java:1469) at io.netty.handler.ssl.SslHandler.access$1800(SslHandler.java:170) at io.netty.handler.ssl.SslHandler$SslTasksRunner.resumeOnEventExecutor(SslHandler.java:1847) ... 9 more ``` Modifications: Add null check Result: Fix NPE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…4830)
Motivation:
We need to check if pendingUnencryptedWrites is null before accessing it as the SslHandler might have been removed in the meantime.
Modifications:
Add null check
Result:
Fix NPE