summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0641
blob: de6786a07706c43cd241178f495963780e45b0f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0641
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0641
Problem:    No check for out-of-memory when converting regexp.
Solution:   Bail out when lalloc() returns NULL. (John Marriott)
Files:	    src/regexp_nfa.c


*** ../vim-8.1.0640/src/regexp_nfa.c	2018-07-17 05:43:50.483214748 +0200
--- src/regexp_nfa.c	2018-12-26 21:52:12.684487595 +0100
***************
*** 3218,3225 ****
  
      if (nfa_calc_size == FALSE)
      {
! 	/* Allocate space for the stack. Max states on the stack : nstate */
  	stack = (Frag_T *)lalloc((nstate + 1) * sizeof(Frag_T), TRUE);
  	stackp = stack;
  	stack_end = stack + (nstate + 1);
      }
--- 3218,3227 ----
  
      if (nfa_calc_size == FALSE)
      {
! 	// Allocate space for the stack. Max states on the stack: "nstate'.
  	stack = (Frag_T *)lalloc((nstate + 1) * sizeof(Frag_T), TRUE);
+ 	if (stack == NULL)
+ 	    return NULL;
  	stackp = stack;
  	stack_end = stack + (nstate + 1);
      }
*** ../vim-8.1.0640/src/version.c	2018-12-26 21:44:49.815970351 +0100
--- src/version.c	2018-12-26 21:53:31.975857388 +0100
***************
*** 801,802 ****
--- 801,804 ----
  {   /* Add new patch number below this line */
+ /**/
+     641,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
53. To find out what time it is, you send yourself an e-mail and check the
    "Date:" field.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///