diff options
author | Peter Valchev <pvalchev@cvs.openbsd.org> | 2005-01-08 05:18:53 +0000 |
---|---|---|
committer | Peter Valchev <pvalchev@cvs.openbsd.org> | 2005-01-08 05:18:53 +0000 |
commit | 021be0ce4540327d8a286e8cbec726576b34f97f (patch) | |
tree | 5eb9d508c0ea057cd1bb749a01f0fbd0b50b448d | |
parent | 23e1909022c06e21addb4a17265e9f2060f9a622 (diff) |
When an error occurs in v_txt(), leave input mode too.
Otherwise, (among other things) db_get() thinks it can re-use the TEXT buffers
when it's not true, leading to a crash because that TEXT buffer will be
released just before it is actually used to create a new one.
From NetBSD, fixes NetBSD PR#21797.
-rw-r--r-- | usr.bin/vi/vi/v_txt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/vi/vi/v_txt.c b/usr.bin/vi/vi/v_txt.c index ab787db588d..a557906ccfa 100644 --- a/usr.bin/vi/vi/v_txt.c +++ b/usr.bin/vi/vi/v_txt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_txt.c,v 1.13 2002/02/17 19:42:34 millert Exp $ */ +/* $OpenBSD: v_txt.c,v 1.14 2005/01/08 05:18:52 pvalchev Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -1458,6 +1458,7 @@ done: /* Leave input mode. */ err: alloc_err: + F_CLR(sp, SC_TINPUT); txt_err(sp, &sp->tiq); return (1); } |