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
pull/1144/head
John Safranek 2026-07-30 14:56:54 -07:00 committed by philljj
parent 075c4ddd94
commit a01ecc6013
1 changed files with 5 additions and 0 deletions

View File

@ -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);