Merge pull request #296 from ejohnstown/skip-bad-guess

KEX Packet Follows Fix
pull/301/head
JacobBarthelmeh 2020-10-27 13:02:19 -06:00 committed by GitHub
commit 36bbb9f9ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1914,7 +1914,10 @@ static int GetNameList(byte* idList, word32* idListSz,
WLOG(WS_LOG_DEBUG, "DNL: name ID = %s", displayName);
}
}
if (id != ID_UNKNOWN) {
if (id != ID_UNKNOWN || idListIdx == 0) {
/* Intentionally save the first one if unknown. This helps
* skipping the KexDhInit if the client sends the wrong one
* as a guess. */
if (idListIdx >= *idListSz) {
WLOG(WS_LOG_ERROR, "No more space left for names");
return WS_BUFFER_E;