summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-01 22:17:05 +0100
committerBram Moolenaar <Bram@vim.org>2017-03-01 22:17:05 +0100
commit66727e16079fbac6db3897b5c3736ec9fba995bb (patch)
tree7cc5cab485cb636ccf3b2aaf546b049492c5c375 /src/search.c
parent5a66dfb25eb478c26176d993393a3b1b124edb39 (diff)
downloadvim-git-66727e16079fbac6db3897b5c3736ec9fba995bb.tar.gz
patch 8.0.0398: illegal memory access with "t"v8.0.0398
Problem: Illegal memory access with "t". Solution: Use strncmp() instead of memcmp(). (Dominique Pelle, closes #1528)
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/search.c b/src/search.c
index 83c584272..d23dde2c8 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1693,12 +1693,9 @@ searchc(cmdarg_T *cap, int t_cmd)
if (p[col] == c && stop)
break;
}
- else
- {
- if (memcmp(p + col, lastc_bytes, lastc_bytelen) == 0
+ else if (STRNCMP(p + col, lastc_bytes, lastc_bytelen) == 0
&& stop)
- break;
- }
+ break;
stop = TRUE;
}
}