diff options
author | S Harris <S.E.Harris@kent.ac.uk> | 2021-06-21 11:04:49 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-23 19:15:07 +0200 |
commit | 5c89e5a04ec445fd0e7437918290bedc71a4ccad (patch) | |
tree | 1c448530ff5f5a7525ce188d97fa5a2d701b6f67 | |
parent | e03b49477a497a231b3aa887155c8f4edc3236a7 (diff) | |
download | busybox-w32-5c89e5a04ec445fd0e7437918290bedc71a4ccad.tar.gz busybox-w32-5c89e5a04ec445fd0e7437918290bedc71a4ccad.tar.bz2 busybox-w32-5c89e5a04ec445fd0e7437918290bedc71a4ccad.zip |
vi: fix read outside of text buffer during insert
Signed-off-by: S Harris <S.E.Harris@kent.ac.uk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/vi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/vi.c b/editors/vi.c index 0baea615b..38ce1fdf0 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -2144,7 +2144,7 @@ static char *char_insert(char *p, char c, int undo) // insert the char c at 'p' | |||
2144 | cmdcnt = 0; | 2144 | cmdcnt = 0; |
2145 | end_cmd_q(); // stop adding to q | 2145 | end_cmd_q(); // stop adding to q |
2146 | last_status_cksum = 0; // force status update | 2146 | last_status_cksum = 0; // force status update |
2147 | if ((p[-1] != '\n') && (dot > text)) { | 2147 | if ((dot > text) && (p[-1] != '\n')) { |
2148 | p--; | 2148 | p--; |
2149 | } | 2149 | } |
2150 | #if ENABLE_FEATURE_VI_SETOPTS | 2150 | #if ENABLE_FEATURE_VI_SETOPTS |