Commit 43220cf4 authored by Niels Möller's avatar Niels Möller

* src/server_session.c (make_pty): assert that the pty is alive.

(do_alloc_pty): Likewise.

Rev: src/server_session.c:1.52
parent 0acbe521
...@@ -390,8 +390,10 @@ static int make_pty(struct pty_info *pty, int *in, int *out, int *err) ...@@ -390,8 +390,10 @@ static int make_pty(struct pty_info *pty, int *in, int *out, int *err)
pty->super.alive, pty->master, pty->slave); pty->super.alive, pty->master, pty->slave);
debug("\n"); debug("\n");
if (pty && pty->super.alive) if (pty)
{ {
assert(pty->super.alive);
debug("make_pty: Using allocated pty.\n"); debug("make_pty: Using allocated pty.\n");
in[0] = pty->slave; in[0] = pty->slave;
in[1] = pty->master; in[1] = pty->master;
...@@ -881,7 +883,7 @@ do_alloc_pty(struct channel_request *c UNUSED, ...@@ -881,7 +883,7 @@ do_alloc_pty(struct channel_request *c UNUSED,
if (tty_getattr(pty->slave, &ios)) if (tty_getattr(pty->slave, &ios))
{ {
pty->super.alive = 1; assert(pty->super.alive);
session->pty = pty; session->pty = pty;
/* Don't set TERM if the value is empty. */ /* Don't set TERM if the value is empty. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment