summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-05 16:33:10 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-05 16:33:10 +0200
commit5b84ddcceae72c14c3f608006d305f9a8e00fefc (patch)
tree5285a074362c8cb4ffbd87ca57af59c52a0a37c0
parent1cd3f2c4507ad242a6ed50270009f19fa49e5a7b (diff)
downloadvim-git-5b84ddcceae72c14c3f608006d305f9a8e00fefc.tar.gz
updated for version 7.3.1120v7.3.1120
Problem: Crash when regexp logging is enabled. Solution: Avoid using NULL pointers. Advance over count argument.
-rw-r--r--src/regexp.c8
-rw-r--r--src/regexp_nfa.c9
-rw-r--r--src/version.c2
3 files changed, 16 insertions, 3 deletions
diff --git a/src/regexp.c b/src/regexp.c
index 853d25573..bf640fce2 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -6538,10 +6538,16 @@ regdump(pattern, r)
end = next;
if (op == BRACE_LIMITS)
{
- /* Two short ints */
+ /* Two ints */
fprintf(f, " minval %ld, maxval %ld", OPERAND_MIN(s), OPERAND_MAX(s));
s += 8;
}
+ else if (op == BEHIND || op == NOBEHIND)
+ {
+ /* one int */
+ fprintf(f, " count %ld", OPERAND_MIN(s));
+ s += 4;
+ }
s += 3;
if (op == ANYOF || op == ANYOF + ADD_NL
|| op == ANYBUT || op == ANYBUT + ADD_NL
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 4dea47c77..5873cfcc1 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -2960,10 +2960,15 @@ log_subexpr(sub)
sub->list.multi[j].end.col,
(int)sub->list.multi[j].end.lnum);
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\"",
j,
- (char *)sub->list.line[j].start,
- (char *)sub->list.line[j].end);
+ s == NULL ? "NULL" : s,
+ e == NULL ? "NULL" : e);
+ }
fprintf(log_fd, "\n");
}
#endif
diff --git a/src/version.c b/src/version.c
index 8bb135a33..f6585e1f2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1120,
+/**/
1119,
/**/
1118,