commit 98f2df931ad8657f21124d8a6024967c5997fc99 parent 6969d3d7491fc2f10d80309b26dd0c26d211b1b3 Author: Lewis Russell <lewis6991@gmail.com> Date: Mon, 6 Mar 2023 16:10:04 +0000 fix(diff): add NULL check Diffstat:
| M | src/nvim/linematch.c | | | 3 | +++ |
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/nvim/linematch.c b/src/nvim/linematch.c @@ -161,6 +161,9 @@ void fastforward_buf_to_lnum(const char **s, long lnum) { for (long i = 0; i < lnum - 1; i++) { *s = strchr(*s, '\n'); + if (!*s) { + return; + } (*s)++; } }