summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2004-01-07 10:12:59 +0000
committerjoerg <joerg@FreeBSD.org>2004-01-07 10:12:59 +0000
commit94e6e7d168bd2ba66a185425744def4fc3761aef (patch)
tree44be24d616fe33fbd1c1bd727ead0c0b5ce997a8 /sys/i386/isa
parent67bfe86083a41c907ae64ed3fe8302aa556d4978 (diff)
downloadFreeBSD-src-94e6e7d168bd2ba66a185425744def4fc3761aef.zip
FreeBSD-src-94e6e7d168bd2ba66a185425744def4fc3761aef.tar.gz
Fix a long-standing bug that had been introduced in rev 1.24 with the
replacement of struct proc by struct thread. This bug could cause a NULL pointer dereferencation under certain circumstances (e. g. while running /etc/rc.d/pcvt).
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/pcvt/pcvt_ext.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_ext.c b/sys/i386/isa/pcvt/pcvt_ext.c
index e2897b5..ea02437f 100644
--- a/sys/i386/isa/pcvt/pcvt_ext.c
+++ b/sys/i386/isa/pcvt/pcvt_ext.c
@@ -2397,7 +2397,7 @@ vgapage(int new_screen)
int
usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct thread *td)
{
- struct proc *p = td->td_proc;
+ struct proc *p;
int i, j, error, opri;
struct vt_mode newmode;
@@ -2406,6 +2406,7 @@ usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct thread *td)
case VT_SETMODE:
newmode = *(struct vt_mode *)data;
+ p = td->td_proc;
opri = spltty();
@@ -2479,6 +2480,8 @@ usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct thread *td)
return 0;
case VT_RELDISP:
+ p = td->td_proc;
+
if (minor(dev) != current_video_screen)
return EPERM;
if (vsp->smode.mode != VT_PROCESS)
OpenPOWER on IntegriCloud