Karsten Hopp 48d68d
To: vim_dev@googlegroups.com
Karsten Hopp 48d68d
Subject: Patch 7.3.1120
Karsten Hopp 48d68d
Fcc: outbox
Karsten Hopp 48d68d
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 48d68d
Mime-Version: 1.0
Karsten Hopp 48d68d
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 48d68d
Content-Transfer-Encoding: 8bit
Karsten Hopp 48d68d
------------
Karsten Hopp 48d68d
Karsten Hopp 48d68d
Patch 7.3.1120
Karsten Hopp 48d68d
Problem:    Crash when regexp logging is enabled.
Karsten Hopp 48d68d
Solution:   Avoid using NULL pointers. Advance over count argument.
Karsten Hopp 48d68d
Files:	    src/regexp.c, src/regexp_nfa.c
Karsten Hopp 48d68d
Karsten Hopp 48d68d
Karsten Hopp 48d68d
*** ../vim-7.3.1119/src/regexp.c	2013-06-05 12:43:05.000000000 +0200
Karsten Hopp 48d68d
--- src/regexp.c	2013-06-05 16:27:25.000000000 +0200
Karsten Hopp 48d68d
***************
Karsten Hopp 48d68d
*** 6538,6547 ****
Karsten Hopp 48d68d
  	    end = next;
Karsten Hopp 48d68d
  	if (op == BRACE_LIMITS)
Karsten Hopp 48d68d
  	{
Karsten Hopp 48d68d
! 	    /* Two short ints */
Karsten Hopp 48d68d
  	    fprintf(f, " minval %ld, maxval %ld", OPERAND_MIN(s), OPERAND_MAX(s));
Karsten Hopp 48d68d
  	    s += 8;
Karsten Hopp 48d68d
  	}
Karsten Hopp 48d68d
  	s += 3;
Karsten Hopp 48d68d
  	if (op == ANYOF || op == ANYOF + ADD_NL
Karsten Hopp 48d68d
  		|| op == ANYBUT || op == ANYBUT + ADD_NL
Karsten Hopp 48d68d
--- 6538,6553 ----
Karsten Hopp 48d68d
  	    end = next;
Karsten Hopp 48d68d
  	if (op == BRACE_LIMITS)
Karsten Hopp 48d68d
  	{
Karsten Hopp 48d68d
! 	    /* Two ints */
Karsten Hopp 48d68d
  	    fprintf(f, " minval %ld, maxval %ld", OPERAND_MIN(s), OPERAND_MAX(s));
Karsten Hopp 48d68d
  	    s += 8;
Karsten Hopp 48d68d
  	}
Karsten Hopp 48d68d
+ 	else if (op == BEHIND || op == NOBEHIND)
Karsten Hopp 48d68d
+ 	{
Karsten Hopp 48d68d
+ 	    /* one int */
Karsten Hopp 48d68d
+ 	    fprintf(f, " count %ld", OPERAND_MIN(s));
Karsten Hopp 48d68d
+ 	    s += 4;
Karsten Hopp 48d68d
+ 	}
Karsten Hopp 48d68d
  	s += 3;
Karsten Hopp 48d68d
  	if (op == ANYOF || op == ANYOF + ADD_NL
Karsten Hopp 48d68d
  		|| op == ANYBUT || op == ANYBUT + ADD_NL
Karsten Hopp 48d68d
*** ../vim-7.3.1119/src/regexp_nfa.c	2013-06-05 12:43:05.000000000 +0200
Karsten Hopp 48d68d
--- src/regexp_nfa.c	2013-06-05 16:13:25.000000000 +0200
Karsten Hopp 48d68d
***************
Karsten Hopp 48d68d
*** 2960,2969 ****
Karsten Hopp 48d68d
  		    sub->list.multi[j].end.col,
Karsten Hopp 48d68d
  		    (int)sub->list.multi[j].end.lnum);
Karsten Hopp 48d68d
  	else
Karsten Hopp 48d68d
  	    fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"",
Karsten Hopp 48d68d
  		    j,
Karsten Hopp 48d68d
! 		    (char *)sub->list.line[j].start,
Karsten Hopp 48d68d
! 		    (char *)sub->list.line[j].end);
Karsten Hopp 48d68d
      fprintf(log_fd, "\n");
Karsten Hopp 48d68d
  }
Karsten Hopp 48d68d
  #endif
Karsten Hopp 48d68d
--- 2960,2974 ----
Karsten Hopp 48d68d
  		    sub->list.multi[j].end.col,
Karsten Hopp 48d68d
  		    (int)sub->list.multi[j].end.lnum);
Karsten Hopp 48d68d
  	else
Karsten Hopp 48d68d
+ 	{
Karsten Hopp 48d68d
+ 	    char *s = (char *)sub->list.line[j].start;
Karsten Hopp 48d68d
+ 	    char *e = (char *)sub->list.line[j].end;
Karsten Hopp 48d68d
+ 
Karsten Hopp 48d68d
  	    fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"",
Karsten Hopp 48d68d
  		    j,
Karsten Hopp 48d68d
! 		    s == NULL ? "NULL" : s,
Karsten Hopp 48d68d
! 		    e == NULL ? "NULL" : e);
Karsten Hopp 48d68d
! 	}
Karsten Hopp 48d68d
      fprintf(log_fd, "\n");
Karsten Hopp 48d68d
  }
Karsten Hopp 48d68d
  #endif
Karsten Hopp 48d68d
*** ../vim-7.3.1119/src/version.c	2013-06-05 12:43:05.000000000 +0200
Karsten Hopp 48d68d
--- src/version.c	2013-06-05 16:27:14.000000000 +0200
Karsten Hopp 48d68d
***************
Karsten Hopp 48d68d
*** 730,731 ****
Karsten Hopp 48d68d
--- 730,733 ----
Karsten Hopp 48d68d
  {   /* Add new patch number below this line */
Karsten Hopp 48d68d
+ /**/
Karsten Hopp 48d68d
+     1120,
Karsten Hopp 48d68d
  /**/
Karsten Hopp 48d68d
Karsten Hopp 48d68d
-- 
Karsten Hopp 48d68d
From "know your smileys":
Karsten Hopp 48d68d
 |-P	Reaction to unusually ugly C code
Karsten Hopp 48d68d
Karsten Hopp 48d68d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 48d68d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 48d68d
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 48d68d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///