Problem: MS-Windows: possible buffer-under run in if_cscope
cs_pathcomponents() (Murali Aniruddhan)
Solution: Fix the loop and do not decrement the pointer twice.
closes: #18091
Signed-off-by: Christian Brabandt <cb@256bit.org>
s = path + strlen(path) - 1;
for (i = 0; i < p_cspc; ++i)
- while (s > path && *--s != '/'
+ {
+ while (s > path)
+ {
+ s--;
+ if (*s == '/'
#ifdef MSWIN
- && *--s != '\\'
+ || *s == '\\'
#endif
)
- ;
+ break;
+ }
+ }
if ((s > path && *s == '/')
#ifdef MSWIN
|| (s > path && *s == '\\')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1680,
/**/
1679,
/**/