summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraymeric <aymeric@NetBSD.org>2003-06-06 08:06:47 +0000
committeraymeric <aymeric@NetBSD.org>2003-06-06 08:06:47 +0000
commitbaffc152bc9a4c6b5ea85cd4e47b2982f0e70aaf (patch)
tree98ebd93bba3bd5c2eda5598c1861077f95e7b21d
parenta07ae6a9df336596c0c9a8028ee53848f631d16d (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. This fixes PR#21797.
-rw-r--r--usr.bin/vi/vi/v_txt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/vi/vi/v_txt.c b/usr.bin/vi/vi/v_txt.c
index 1aba4d981a1..f11246f9797 100644
--- a/usr.bin/vi/vi/v_txt.c
+++ b/usr.bin/vi/vi/v_txt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: v_txt.c,v 1.10 2003/01/06 20:30:41 wiz Exp $ */
+/* $NetBSD: v_txt.c,v 1.11 2003/06/06 08:06:47 aymeric Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -16,7 +16,7 @@
#if 0
static const char sccsid[] = "@(#)v_txt.c 10.87 (Berkeley) 10/13/96";
#else
-__RCSID("$NetBSD: v_txt.c,v 1.10 2003/01/06 20:30:41 wiz Exp $");
+__RCSID("$NetBSD: v_txt.c,v 1.11 2003/06/06 08:06:47 aymeric Exp $");
#endif
#endif /* not lint */
@@ -1471,6 +1471,7 @@ done: /* Leave input mode. */
err:
alloc_err:
+ F_CLR(sp, SC_TINPUT);
txt_err(sp, &sp->tiq);
return (1);
}