sshd: Fix env error check

Co-Authored-By: Chris Miller <millerlogic@users.noreply.github.com>
This commit is contained in:
Andrey Petrov 2020-01-10 09:25:59 -05:00 committed by GitHub
parent 4aa2460d82
commit 6701cbcbf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,7 +189,7 @@ func (t *Terminal) listen(requests <-chan *ssh.Request) {
}
case "env":
var v EnvVar
if err := ssh.Unmarshal(req.Payload, &v); err != nil {
if err := ssh.Unmarshal(req.Payload, &v); err == nil {
t.mu.Lock()
t.env = append(t.env, v)
t.mu.Unlock()