patch 8.0.0398: illegal memory access with "t"
Problem: Illegal memory access with "t".
Solution: Use strncmp() instead of memcmp(). (Dominique Pelle, closes #1528)
diff --git a/src/search.c b/src/search.c
index 83c5842..d23dde2 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1693,12 +1693,9 @@
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;
}
}