-
Bug
-
Resolution: Done
-
Major
-
None
-
-
Compatibility/Configuration
If a websocket ExtensionHandshake is available but fails negotiation against the client-supplied extensions, the websocket connection will die with a null pointer exception.
The problem is that the Handshake class does not check the result of ExtensionHandshake.accept(WebSocketExtension ext) for null (meaning the extension should not be used) before adding this extension to the list of selected and configured extensions on the connection. The null blows up later.
More concretely, line 202 in master currently reads:
WebSocketExtension negotiated = extHandshake.accept(ext); if (ext != null && !extHandshake.isIncompatible(configured)) { selected.add(negotiated); configured.add(extHandshake); }
It should read:
WebSocketExtension negotiated = extHandshake.accept(ext); if (negotiated != null && !extHandshake.isIncompatible(configured)) { selected.add(negotiated); configured.add(extHandshake); }
Note the null check was on ext (which is probably incorrect: Handshake.accept() will check it for null already and this item is from server configuration--its unlikely to have nulls in it). The null check should be on negotiated.