mirror of https://github.com/wolfSSL/wolfssh.git
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-7214pull/1144/head
parent
075c4ddd94
commit
a01ecc6013
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue