1
0
forked from aniani/vim

updated for version 7.3.1120

Problem:    Crash when regexp logging is enabled.
Solution:   Avoid using NULL pointers. Advance over count argument.
This commit is contained in:
Bram Moolenaar
2013-06-05 16:33:10 +02:00
parent 1cd3f2c450
commit 5b84ddccea
3 changed files with 16 additions and 3 deletions

View File

@@ -6538,10 +6538,16 @@ regdump(pattern, r)
end = next; end = next;
if (op == BRACE_LIMITS) if (op == BRACE_LIMITS)
{ {
/* Two short ints */ /* Two ints */
fprintf(f, " minval %ld, maxval %ld", OPERAND_MIN(s), OPERAND_MAX(s)); fprintf(f, " minval %ld, maxval %ld", OPERAND_MIN(s), OPERAND_MAX(s));
s += 8; s += 8;
} }
else if (op == BEHIND || op == NOBEHIND)
{
/* one int */
fprintf(f, " count %ld", OPERAND_MIN(s));
s += 4;
}
s += 3; s += 3;
if (op == ANYOF || op == ANYOF + ADD_NL if (op == ANYOF || op == ANYOF + ADD_NL
|| op == ANYBUT || op == ANYBUT + ADD_NL || op == ANYBUT || op == ANYBUT + ADD_NL

View File

@@ -2960,10 +2960,15 @@ log_subexpr(sub)
sub->list.multi[j].end.col, sub->list.multi[j].end.col,
(int)sub->list.multi[j].end.lnum); (int)sub->list.multi[j].end.lnum);
else else
{
char *s = (char *)sub->list.line[j].start;
char *e = (char *)sub->list.line[j].end;
fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"", fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"",
j, j,
(char *)sub->list.line[j].start, s == NULL ? "NULL" : s,
(char *)sub->list.line[j].end); e == NULL ? "NULL" : e);
}
fprintf(log_fd, "\n"); fprintf(log_fd, "\n");
} }
#endif #endif

View File

@@ -728,6 +728,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1120,
/**/ /**/
1119, 1119,
/**/ /**/