Skip to content

Commit fffbf30

Browse files
committed
patch 8.0.0223: Coverity warns for an uninitialized variable
Problem: Coverity gets confused by the flags passed to find_tags() and warnts for an uninitialized variable. Solution: Disallow using cscope and help tags at the same time.
1 parent c812996 commit fffbf30

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/tag.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,7 @@ prepare_pats(pat_T *pats, int has_re)
12561256
* TAG_REGEXP use "pat" as a regexp
12571257
* TAG_NOIC don't always ignore case
12581258
* TAG_KEEP_LANG keep language
1259+
* TAG_CSCOPE use cscope results for tags
12591260
*/
12601261
int
12611262
find_tags(
@@ -1423,6 +1424,14 @@ find_tags(
14231424
*/
14241425
if (help_only) /* want tags from help file */
14251426
curbuf->b_help = TRUE; /* will be restored later */
1427+
#ifdef FEAT_CSCOPE
1428+
else if (use_cscope)
1429+
{
1430+
/* Make sure we don't mix help and cscope, confuses Coverity. */
1431+
help_only = FALSE;
1432+
curbuf->b_help = FALSE;
1433+
}
1434+
#endif
14261435

14271436
orgpat.len = (int)STRLEN(pat);
14281437
#ifdef FEAT_MULTI_LANG
@@ -2281,7 +2290,8 @@ find_tags(
22812290
*/
22822291
*tagp.tagname_end = NUL;
22832292
len = (int)(tagp.tagname_end - tagp.tagname);
2284-
mfp = (char_u *)alloc((int)sizeof(char_u) + len + 10 + ML_EXTRA + 1);
2293+
mfp = (char_u *)alloc((int)sizeof(char_u)
2294+
+ len + 10 + ML_EXTRA + 1);
22852295
if (mfp != NULL)
22862296
{
22872297
int heuristic;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
223,
767769
/**/
768770
222,
769771
/**/

0 commit comments

Comments
 (0)