From a01ecc601362513cd3c3f6fe4cb80c5ef32fcb83 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 30 Jul 2026 14:56:54 -0700 Subject: [PATCH] agent: null check ssh->agent in worker - wolfSSH_AGENT_worker() dereferenced ssh->agent to set the DONE state without checking it, so a call before the agent was set up took a null dereference. - Return WS_AGENT_NULL_E instead. Issue: F-7214 --- src/agent.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/agent.c b/src/agent.c index 79a9390b..0d030704 100644 --- a/src/agent.c +++ b/src/agent.c @@ -1701,6 +1701,11 @@ int wolfSSH_AGENT_worker(WOLFSSH* ssh) if (ssh == NULL) ret = WS_SSH_NULL_E; + if (ret == WS_SUCCESS) { + if (ssh->agent == NULL) + ret = WS_AGENT_NULL_E; + } + if (ret == WS_SUCCESS) { SendSuccess(NULL); DoMessage(NULL, NULL, 0, NULL);