Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUACAMOLE-1846: Check for NULLs before attempting to sync state in join pending handlers. #460

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/protocols/kubernetes/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ static int guac_kubernetes_join_pending_handler(guac_client* client) {
(guac_kubernetes_client*) client->data;

/* Synchronize the terminal state to all pending users */
guac_socket* broadcast_socket = client->pending_socket;
guac_terminal_sync_users(kubernetes_client->term, client, broadcast_socket);
guac_kubernetes_send_current_argv_batch(client, broadcast_socket);
guac_socket_flush(broadcast_socket);
if (kubernetes_client->term != NULL) {
guac_socket* broadcast_socket = client->pending_socket;
guac_terminal_sync_users(kubernetes_client->term, client, broadcast_socket);
guac_kubernetes_send_current_argv_batch(client, broadcast_socket);
guac_socket_flush(broadcast_socket);
}

return 0;

Expand Down
7 changes: 4 additions & 3 deletions src/protocols/rdp/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ static int guac_rdp_join_pending_handler(guac_client* client) {
guac_rdp_pipe_svc_send_pipes(client, broadcast_socket);

/* Synchronize with current display */
guac_common_display_dup(rdp_client->display, client, broadcast_socket);

guac_socket_flush(broadcast_socket);
if (rdp_client->display != NULL) {
guac_common_display_dup(rdp_client->display, client, broadcast_socket);
guac_socket_flush(broadcast_socket);
}

return 0;

Expand Down
10 changes: 6 additions & 4 deletions src/protocols/ssh/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ static int guac_ssh_join_pending_handler(guac_client* client) {
guac_ssh_client* ssh_client = (guac_ssh_client*) client->data;

/* Synchronize the terminal state to all pending users */
guac_socket* broadcast_socket = client->pending_socket;
guac_terminal_sync_users(ssh_client->term, client, broadcast_socket);
guac_ssh_send_current_argv_batch(client, broadcast_socket);
guac_socket_flush(broadcast_socket);
if (ssh_client->term != NULL) {
guac_socket* broadcast_socket = client->pending_socket;
guac_terminal_sync_users(ssh_client->term, client, broadcast_socket);
guac_ssh_send_current_argv_batch(client, broadcast_socket);
guac_socket_flush(broadcast_socket);
}

return 0;

Expand Down
10 changes: 6 additions & 4 deletions src/protocols/telnet/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ static int guac_telnet_join_pending_handler(guac_client* client) {
guac_telnet_client* telnet_client = (guac_telnet_client*) client->data;

/* Synchronize the terminal state to all pending users */
guac_socket* broadcast_socket = client->pending_socket;
guac_terminal_sync_users(telnet_client->term, client, broadcast_socket);
guac_telnet_send_current_argv_batch(client, broadcast_socket);
guac_socket_flush(broadcast_socket);
if (telnet_client->term != NULL) {
guac_socket* broadcast_socket = client->pending_socket;
guac_terminal_sync_users(telnet_client->term, client, broadcast_socket);
guac_telnet_send_current_argv_batch(client, broadcast_socket);
guac_socket_flush(broadcast_socket);
}

return 0;

Expand Down
6 changes: 4 additions & 2 deletions src/protocols/vnc/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ static int guac_vnc_join_pending_handler(guac_client* client) {
#endif

/* Synchronize with current display */
guac_common_display_dup(vnc_client->display, client, broadcast_socket);
guac_socket_flush(broadcast_socket);
if (vnc_client->display != NULL) {
guac_common_display_dup(vnc_client->display, client, broadcast_socket);
guac_socket_flush(broadcast_socket);
}

return 0;

Expand Down