From 669bf92683d0e2a88f50a671666c2811b069a105 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Tue, 4 Feb 2025 11:18:51 +0000 Subject: [PATCH] Fix crash when client has no hostname If the client is not provided a hostname, `ClientPublicKeyCheck` would crash trying to match `targetName`. A hostname is required. --- apps/wolfssh/wolfssh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/wolfssh/wolfssh.c b/apps/wolfssh/wolfssh.c index 5bf7d71e..d85bc024 100644 --- a/apps/wolfssh/wolfssh.c +++ b/apps/wolfssh/wolfssh.c @@ -923,6 +923,9 @@ static THREAD_RETURN WOLFSSH_THREAD wolfSSH_Client(void* args) if (config.user == NULL) err_sys("client requires a username parameter."); + if (config.hostname == NULL) + err_sys("client requires a hostname parameter."); + #ifdef SINGLE_THREADED if (keepOpen) err_sys("Threading needed for terminal session\n");