mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-05 20:57:40 +00:00
Fix NPE if end-of-stream encountered during handshake (fixes #195).
This commit is contained in:
@@ -40,6 +40,7 @@ package net.sourceforge.guacamole.protocol;
|
||||
import net.sourceforge.guacamole.io.GuacamoleReader;
|
||||
import net.sourceforge.guacamole.io.GuacamoleWriter;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.GuacamoleServerException;
|
||||
import net.sourceforge.guacamole.net.GuacamoleSocket;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||
|
||||
@@ -86,7 +87,12 @@ public class ConfiguredGuacamoleSocket implements GuacamoleSocket {
|
||||
// Wait for server args
|
||||
GuacamoleInstruction instruction;
|
||||
do {
|
||||
|
||||
// Read instruction, fail if end-of-stream
|
||||
instruction = reader.readInstruction();
|
||||
if (instruction == null)
|
||||
throw new GuacamoleServerException("End of stream during initial handshake.");
|
||||
|
||||
} while (instruction.getOperation() != Operation.SERVER_ARGS);
|
||||
|
||||
// Build args list off provided names and config
|
||||
|
Reference in New Issue
Block a user