Merge pull request #55 from glyptodon/rdp-null-settings

GUAC-1171: RDP settings values may be NULL.
This commit is contained in:
James Muehlner 2015-07-14 10:52:53 -07:00
commit 1ecec68a20

View File

@ -828,7 +828,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
/* Parse username - use RDP username by default */ /* Parse username - use RDP username by default */
const char* sftp_username = argv[IDX_SFTP_USERNAME]; const char* sftp_username = argv[IDX_SFTP_USERNAME];
if (sftp_username[0] == '\0') if (sftp_username[0] == '\0' && settings->username != NULL)
sftp_username = settings->username; sftp_username = settings->username;
guac_common_ssh_user* user = guac_common_ssh_create_user(sftp_username); guac_common_ssh_user* user = guac_common_ssh_create_user(sftp_username);
@ -855,7 +855,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
/* Parse password - use RDP password by default */ /* Parse password - use RDP password by default */
const char* sftp_password = argv[IDX_SFTP_USERNAME]; const char* sftp_password = argv[IDX_SFTP_USERNAME];
if (sftp_password[0] == '\0') if (sftp_password[0] == '\0' && settings->password != NULL)
sftp_password = settings->password; sftp_password = settings->password;
guac_common_ssh_user_set_password(user, sftp_password); guac_common_ssh_user_set_password(user, sftp_password);