1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2017-03-01 22:17:05 +01:00
parent 5a66dfb25e
commit 66727e1607
3 changed files with 11 additions and 5 deletions

View File

@@ -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;
}
}