Closed joseparis113 closed 3 years ago
In WebSocketOutputStream.java an exception is thrown at writeFramePayload when payload is returned as null from frame.getPayload() because the test for nullity is done after checking for payload.length. It should be done after that check:
private void writeFramePayload(WebSocketFrame frame, byte[] maskingKey) throws IOException { byte[] payload = frame.getPayload(); byte[] masked = new byte[payload.length]; if (payload == null) { return; } .......................
Should be: ........... if (payload == null) { return; } byte[] masked = new byte[payload.length]; ...........
In WebSocketOutputStream.java an exception is thrown at writeFramePayload when payload is returned as null from frame.getPayload() because the test for nullity is done after checking for payload.length. It should be done after that check:
private void writeFramePayload(WebSocketFrame frame, byte[] maskingKey) throws IOException { byte[] payload = frame.getPayload(); byte[] masked = new byte[payload.length]; if (payload == null) { return; } .......................
Should be: ........... if (payload == null) { return; } byte[] masked = new byte[payload.length]; ...........