From 021be0ce4540327d8a286e8cbec726576b34f97f Mon Sep 17 00:00:00 2001 From: Peter Valchev Date: Sat, 8 Jan 2005 05:18:53 +0000 Subject: 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. --- usr.bin/vi/vi/v_txt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.bin/vi') 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); } -- cgit v1.2.3