Bug 2790 - parameter ssh of function ssh channel_clear_permitted_opens could be NULL
Summary: parameter ssh of function ssh channel_clear_permitted_opens could be NULL
Status: CLOSED INVALID
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 7.6p1
Hardware: Other Other
: P5 critical
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-06 12:22 AEDT by bingbing8
Modified: 2018-01-30 06:42 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bingbing8 2017-10-06 12:22:50 AEDT
key base auth fail on windows because parameter ssh ssh-agent on windows is null and the demon crashes. ssh-agent does not call auth_clear_options but it does not need to call packet_set_connection. 


void
channel_clear_permitted_opens(struct ssh *ssh)
{
	struct ssh_channels *sc = ssh->chanctxt;

	sc->permitted_opens = xrecallocarray(sc->permitted_opens,
	    sc->num_permitted_opens, 0, sizeof(*sc->permitted_opens));
	sc->num_permitted_opens = 0;
}

Please add parameter check.

	if(ssh == NULL)
		return;
Comment 1 Damien Miller 2017-10-23 12:21:12 AEDT
This call is nonsensical with a NULL argument. How does the Windows port end up attempting it?