[git commit] vi: fix read outside of text buffer during insert
Denys Vlasenko
vda.linux at googlemail.com
Wed Jun 23 17:15:07 UTC 2021
commit: https://git.busybox.net/busybox/commit/?id=5c89e5a04ec445fd0e7437918290bedc71a4ccad
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
Signed-off-by: S Harris <S.E.Harris at kent.ac.uk>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
editors/vi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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'
cmdcnt = 0;
end_cmd_q(); // stop adding to q
last_status_cksum = 0; // force status update
- if ((p[-1] != '\n') && (dot > text)) {
+ if ((dot > text) && (p[-1] != '\n')) {
p--;
}
#if ENABLE_FEATURE_VI_SETOPTS
More information about the busybox-cvs
mailing list