Bug 66681 - .getBasicRemote().flushBatch() causes NPE with PerMessageDeflate
Summary: .getBasicRemote().flushBatch() causes NPE with PerMessageDeflate
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: WebSocket (show other bugs)
Version: 9.0.76
Hardware: All All
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-07 21:51 UTC by Alex Panchenko
Modified: 2023-07-24 15:15 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Panchenko 2023-07-07 21:51:20 UTC
java.lang.NullPointerException: Cannot invoke "java.nio.ByteBuffer.limit()" because the return value of "org.apache.tomcat.websocket.MessagePart.getPayload()" is null
	at org.apache.tomcat.websocket.PerMessageDeflate.sendMessagePart(PerMessageDeflate.java:317)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:282)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:256)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.flushBatch(WsRemoteEndpointImplBase.java:124)
	at org.apache.tomcat.websocket.WsRemoteEndpointBase.flushBatch(WsRemoteEndpointBase.java:48)
Comment 1 Mark Thomas 2023-07-24 15:15:02 UTC
This has been fixed in:

- 11.0.x for 11.0.0-M10 onwards
- 10.1.x for 10.1.12 onwards
- 9.0.x for 9.0.79 onwards
- 8.5.x for 8.5.92 onwards