diff options
author | joerg <joerg@FreeBSD.org> | 1995-04-10 18:34:51 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1995-04-10 18:34:51 +0000 |
commit | 737b1e8264ce7dd43e08ab6e469c221cd05e9ca7 (patch) | |
tree | 3cccdbfec0f903a739db3564b549a3132341929b /sys/i386/isa/pcvt/pcvt_sup.c | |
parent | 30e9776583b70f059368c8d44ad1436549dfe262 (diff) | |
download | FreeBSD-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_sup.c')
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_sup.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_sup.c b/sys/i386/isa/pcvt/pcvt_sup.c index 728a9ab..6f64570 100644 --- a/sys/i386/isa/pcvt/pcvt_sup.c +++ b/sys/i386/isa/pcvt/pcvt_sup.c @@ -742,11 +742,15 @@ set_screen_size(struct video_state *svsp, int size) /* Update tty to reflect screen size */ - svsp->vs_tty->t_winsize.ws_col = svsp->maxcol; - svsp->vs_tty->t_winsize.ws_xpixel = - (svsp->maxcol == 80)? 720: 1056; - svsp->vs_tty->t_winsize.ws_ypixel = 400; - + if (svsp->vs_tty) + { + svsp->vs_tty->t_winsize.ws_col = svsp->maxcol; + svsp->vs_tty->t_winsize.ws_xpixel = + (svsp->maxcol == 80)? 720: 1056; + svsp->vs_tty->t_winsize.ws_ypixel = 400; + svsp->vs_tty->t_winsize.ws_row = + svsp->screen_rows; + } /* screen_rows already calculated in set_charset() */ if(svsp->vt_pure_mode == M_HPVT && svsp->labels_on) { @@ -756,13 +760,13 @@ set_screen_size(struct video_state *svsp, int size) sw_ufkl(svsp); } - 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 */ break; |