GUACAMOLE-527: Fix issue with null host_key variable.

This commit is contained in:
Nick Couchman 2018-04-05 11:28:32 -04:00 committed by Nick Couchman
parent 2f0c6dcfa3
commit c080569cac

View File

@ -520,7 +520,7 @@ guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client,
libssh2_knownhost_readfile(ssh_known_hosts, known_hosts, LIBSSH2_KNOWNHOST_FILE_OPENSSH); libssh2_knownhost_readfile(ssh_known_hosts, known_hosts, LIBSSH2_KNOWNHOST_FILE_OPENSSH);
/* Add host key provided from settings */ /* Add host key provided from settings */
if (strcmp(host_key, "") > 0) { if (host_key && strcmp(host_key, "") > 0) {
if (libssh2_knownhost_addc(ssh_known_hosts, hostname, NULL, host_key, strlen(host_key), if (libssh2_knownhost_addc(ssh_known_hosts, hostname, NULL, host_key, strlen(host_key),
NULL, 0, LIBSSH2_KNOWNHOST_TYPE_PLAIN|LIBSSH2_KNOWNHOST_KEYENC_BASE64| NULL, 0, LIBSSH2_KNOWNHOST_TYPE_PLAIN|LIBSSH2_KNOWNHOST_KEYENC_BASE64|