summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-07-10 10:09:49 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-07-10 10:09:49 +0000
commit952e7e7e45876baae0635785ede2698195e3a4b1 (patch)
tree97a9f851c8f93749668174636e48aa17889d05d5
parentf65d2ca225ebaccc0006ce014c3409305e500d99 (diff)
Fix a SEGV after you HUP vi; dean@netbsd.org
-rw-r--r--usr.bin/vi/vi/vs_refresh.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/vi/vi/vs_refresh.c b/usr.bin/vi/vi/vs_refresh.c
index 81587608c1a..8e3770a104d 100644
--- a/usr.bin/vi/vi/vs_refresh.c
+++ b/usr.bin/vi/vi/vs_refresh.c
@@ -779,6 +779,14 @@ vs_modeline(sp)
int ellipsis;
char *p, buf[20];
+ /*
+ * It's possible that this routine will be called after sp->frp
+ * has been set to NULL by file_end(). We return immediately
+ * to avoid a SEGV.
+ */
+ if (sp->frp == NULL)
+ return;
+
gp = sp->gp;
/*