Problem: Checking NULL pointer after addition. (Coverity)
Solution: First check for NULL, then add the column.
if (lnum < 0 || rsm.sm_mmatch->endpos[no].lnum < 0)
return NULL;
- s = reg_getline_submatch(lnum) + rsm.sm_mmatch->startpos[no].col;
- if (s == NULL) /* anti-crash check, cannot happen? */
+ s = reg_getline_submatch(lnum);
+ if (s == NULL) // anti-crash check, cannot happen?
break;
+ s += rsm.sm_mmatch->startpos[no].col;
if (rsm.sm_mmatch->endpos[no].lnum == lnum)
{
/* Within one line: take form start to end col. */
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1025,
/**/
1024,
/**/