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);