From 4d941545cd8cf76d63ca7e7fc749b5172ac73a35 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 12 Jul 2015 22:27:02 -0700 Subject: [PATCH] GUAC-1171: Ensure directory names are null-terminated. --- src/common-ssh/guac_sftp.c | 2 +- src/protocols/rdp/rdp_stream.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common-ssh/guac_sftp.c b/src/common-ssh/guac_sftp.c index d82b6a1a..a8e7e060 100644 --- a/src/common-ssh/guac_sftp.c +++ b/src/common-ssh/guac_sftp.c @@ -552,7 +552,7 @@ static int guac_common_ssh_sftp_get_handler(guac_client* client, list_state->directory = dir; list_state->sftp_data = sftp_data; strncpy(list_state->directory_name, name, - sizeof(list_state->directory_name)); + sizeof(list_state->directory_name) - 1); /* Allocate stream for body */ guac_stream* stream = guac_client_alloc_stream(client); diff --git a/src/protocols/rdp/rdp_stream.c b/src/protocols/rdp/rdp_stream.c index 299ba078..16aa560e 100644 --- a/src/protocols/rdp/rdp_stream.c +++ b/src/protocols/rdp/rdp_stream.c @@ -486,7 +486,7 @@ int guac_rdp_download_get_handler(guac_client* client, guac_object* object, rdp_stream->ls_status.fs = fs; rdp_stream->ls_status.file_id = file_id; strncpy(rdp_stream->ls_status.directory_name, name, - sizeof(rdp_stream->ls_status.directory_name)); + sizeof(rdp_stream->ls_status.directory_name) - 1); /* Allocate stream for body */ guac_stream* stream = guac_client_alloc_stream(client);