when a host is added, we must make sure the app also provides a key *type* even

though we don't use the type in this function
This commit is contained in:
Daniel Stenberg 2009-05-29 13:58:04 +02:00
parent 2e990194ab
commit 1d31dadc1e

View File

@ -111,6 +111,10 @@ libssh2_knownhost_add(LIBSSH2_KNOWNHOSTS *hosts,
if(!entry)
return rc;
if(!(typemask & LIBSSH2_KNOWNHOST_KEY_MASK))
/* make sure we have a key type set */
return LIBSSH2_ERROR_INVAL;
memset(entry, 0, sizeof(struct known_host));
entry->typemask = typemask;