summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/pcvt/pcvt_out.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-04-10 18:34:51 +0000
committerjoerg <joerg@FreeBSD.org>1995-04-10 18:34:51 +0000
commit737b1e8264ce7dd43e08ab6e469c221cd05e9ca7 (patch)
tree3cccdbfec0f903a739db3564b549a3132341929b /sys/i386/isa/pcvt/pcvt_out.c
parent30e9776583b70f059368c8d44ad1436549dfe262 (diff)
downloadFreeBSD-src-737b1e8264ce7dd43e08ab6e469c221cd05e9ca7.zip
FreeBSD-src-737b1e8264ce7dd43e08ab6e469c221cd05e9ca7.tar.gz
There have been a few occasions where some actions could dereference
uninitialized tty pointers early during boot; it got very obvious when pressing Alt-F11 after a boot -c.
Diffstat (limited to 'sys/i386/isa/pcvt/pcvt_out.c')
-rw-r--r--sys/i386/isa/pcvt/pcvt_out.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_out.c b/sys/i386/isa/pcvt/pcvt_out.c
index df6aeaa..d11fd0f 100644
--- a/sys/i386/isa/pcvt/pcvt_out.c
+++ b/sys/i386/isa/pcvt/pcvt_out.c
@@ -1492,7 +1492,8 @@ set_emulation_mode(struct video_state *svsp, int mode)
svsp->vt_pure_mode = M_HPVT;
- svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
+ if (svsp->vs_tty)
+ svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
svsp->scrr_len = svsp->screen_rows;
svsp->scrr_end = svsp->scrr_len - 1;
@@ -1512,14 +1513,16 @@ set_emulation_mode(struct video_state *svsp, int mode)
if (svsp->force24 && svsp->screen_rows == 25)
svsp->screen_rows = 24;
- svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
+ if (svsp->vs_tty)
+ svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
svsp->scrr_len = svsp->screen_rows;
svsp->scrr_end = svsp->scrr_len - 1;
}
#if PCVT_SIGWINCH
- pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
+ if (svsp->vs_tty && svsp->vs_tty->t_pgrp)
+ pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
#endif /* PCVT_SIGWINCH */
}
@@ -1796,15 +1799,20 @@ vt_col(struct video_state *svsp, int cols)
/* Update winsize struct to reflect screen size */
- svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
- svsp->vs_tty->t_winsize.ws_col = svsp->maxcol;
+ if(svsp->vs_tty)
+ {
+ svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
+ svsp->vs_tty->t_winsize.ws_col = svsp->maxcol;
- svsp->vs_tty->t_winsize.ws_xpixel = (cols == SCR_COL80)? 720: 1056;
- svsp->vs_tty->t_winsize.ws_ypixel = 400;
+ svsp->vs_tty->t_winsize.ws_xpixel =
+ (cols == SCR_COL80)? 720: 1056;
+ svsp->vs_tty->t_winsize.ws_ypixel = 400;
#if PCVT_SIGWINCH
- pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
-#endif /* PCVT_SIGWINCH */
+ if(svsp->vs_tty->t_pgrp)
+ pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
+#endif /* PCVT_SIGWINCH */
+ }
return(1);
}
OpenPOWER on IntegriCloud