GUAC-1171: Ensure directory names are null-terminated.

This commit is contained in:
Michael Jumper 2015-07-12 22:27:02 -07:00
parent 1316743b02
commit 4d941545cd
2 changed files with 2 additions and 2 deletions

View File

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

View File

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