Check that the agent was set in the SSH session before trying to set its channel ID. (ZD 11099)

pull/297/head
John Safranek 2020-10-28 15:50:10 -07:00
parent dec94e79af
commit 7900d47036
No known key found for this signature in database
GPG Key ID: 8CE817DE0D3CCB4A
1 changed files with 4 additions and 1 deletions

View File

@ -4620,7 +4620,10 @@ static int DoChannelOpen(WOLFSSH* ssh,
#ifdef WOLFSSH_AGENT
case ID_CHANTYPE_AUTH_AGENT:
WLOG(WS_LOG_INFO, "agent = %p", ssh->agent);
ssh->agent->channel = peerChannelId;
if (ssh->agent != NULL)
ssh->agent->channel = peerChannelId;
else
ret = WS_AGENT_NULL_E;
break;
#endif
default: