Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/vi/vi Fix for PR 5108 - vi gets SEGV after SIGHUP.



details:   https://anonhg.NetBSD.org/src/rev/e9d03e801d5b
branches:  trunk
changeset: 474487:e9d03e801d5b
user:      dean <dean%NetBSD.org@localhost>
date:      Thu Jul 08 06:09:04 1999 +0000

description:
Fix for PR 5108 - vi gets SEGV after SIGHUP.

diffstat:

 usr.bin/vi/vi/vs_refresh.c |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r 76a0b53c6fad -r e9d03e801d5b usr.bin/vi/vi/vs_refresh.c
--- a/usr.bin/vi/vi/vs_refresh.c        Thu Jul 08 03:06:02 1999 +0000
+++ b/usr.bin/vi/vi/vs_refresh.c        Thu Jul 08 06:09:04 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vs_refresh.c,v 1.2 1998/01/09 08:08:52 perry Exp $     */
+/*     $NetBSD: vs_refresh.c,v 1.3 1999/07/08 06:09:04 dean Exp $      */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -729,6 +729,15 @@
        const char *t;
        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;
 
        /*



Home | Main Index | Thread Index | Old Index