diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-09-28 15:44:51 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-09-28 15:44:51 +0000 |
commit | 53df278e27858755c165de3675a19e0b149a0c7d (patch) | |
tree | 897ede4bef91d6196f69de1306ff6036441ea86b /sys/arch | |
parent | 312c23d957e7b6b17b569ddbb87153b1211128f1 (diff) |
Make sure a Copybuffer has been allocated successfully before we start doing
things with it.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_drv.c | 5 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_mouse.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/i386/isa/pcvt/pcvt_drv.c b/sys/arch/i386/isa/pcvt/pcvt_drv.c index 3675c855038..14ae52ecdc4 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_drv.c +++ b/sys/arch/i386/isa/pcvt/pcvt_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_drv.c,v 1.32 2000/09/22 17:39:05 aaron Exp $ */ +/* $OpenBSD: pcvt_drv.c,v 1.33 2000/09/28 15:44:50 aaron Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. * @@ -295,7 +295,8 @@ pcclose(Dev_t dev, int flag, int mode, struct proc *p) reset_usl_modes(vsx); /* remove the selection at logout */ - bzero(Copybuffer, (vs[0].maxcol + 1) * vs[0].screen_rows); + if (Copybuffer) + bzero(Copybuffer, (vs[0].maxcol + 1) * vs[0].screen_rows); Paste_avail = 0; return(0); diff --git a/sys/arch/i386/isa/pcvt/pcvt_mouse.c b/sys/arch/i386/isa/pcvt/pcvt_mouse.c index c6fb5412865..ee4c45aa23a 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_mouse.c +++ b/sys/arch/i386/isa/pcvt/pcvt_mouse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_mouse.c,v 1.3 2000/09/22 17:39:05 aaron Exp $ */ +/* $OpenBSD: pcvt_mouse.c,v 1.4 2000/09/28 15:44:50 aaron Exp $ */ /* * Copyright (c) 2000 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon @@ -82,6 +82,9 @@ mouse_ioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) mouse_info_t mouse_infos = *(mouse_info_t *) data; unsigned char c; video_state *cs; + + if (Copybuffer == NULL) + return (-1); if (device == PCVTCTL_MINOR && cmd == PCVT_MOUSECTL) { switch (mouse_infos.operation) { |